Could someone please help me how to mark one specific point (at y =100)?

1 次查看(过去 30 天)
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');

采纳的回答

Walter Roberson
Walter Roberson 2021-6-3
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 个评论
Walter Roberson
Walter Roberson 2021-6-3
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');

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by