Could someone please help me how to mark one specific point (at y =100)?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Phat Nguyen
il 3 Giu 2021
Commentato: Phat Nguyen
il 3 Giu 2021
x = [0,0.00275252,0.00321127,0.00342857,0.00359759,0.00400805,0.00434608,0.00473239,0.00497384,0.00526358,0.00540845,0.00589135,0.006833,0.00697787,0.00840241,0.0101408];
y = [0,96.8421,107.068,110.075,108.872,99.2481,92.9323,86.015,81.203,70.9774,67.0677,56.8421,43.0075,41.5038,33.985,33.0827];
plot (x,y,'r','LineWidth',2);
grid on;
xlabel('X');
ylabel('Y');
0 Commenti
Risposta accettata
Walter Roberson
il 3 Giu 2021
x = [0,0.00275252,0.00321127,0.00342857,0.00359759,0.00400805,0.00434608,0.00473239,0.00497384,0.00526358,0.00540845,0.00589135,0.006833,0.00697787,0.00840241,0.0101408];
y = [0,96.8421,107.068,110.075,108.872,99.2481,92.9323,86.015,81.203,70.9774,67.0677,56.8421,43.0075,41.5038,33.985,33.0827];
[~, peakidx] = max(y);
target = 100;
x1 = interp1(y(1:peakidx), x(1:peakidx), target);
x2 = interp1(y(peakidx:end), x(peakidx:end), target);
plot(x, y, 'r');
hold on
xline([x1, x2], 'b')
yline(target, 'b')
hold off
3 Commenti
Walter Roberson
il 3 Giu 2021
x = [0,0.00275252,0.00321127,0.00342857,0.00359759,0.00400805,0.00434608,0.00473239,0.00497384,0.00526358,0.00540845,0.00589135,0.006833,0.00697787,0.00840241,0.0101408];
y = [0,96.8421,107.068,110.075,108.872,99.2481,92.9323,86.015,81.203,70.9774,67.0677,56.8421,43.0075,41.5038,33.985,33.0827];
[~, peakidx] = max(y);
target = 100;
x1 = interp1(y(1:peakidx), x(1:peakidx), target);
x2 = interp1(y(peakidx:end), x(peakidx:end), target);
plot(x, y, 'r', [x1, x2], target, 'bo');
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Startup and Shutdown in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!