Could someone please help me how to mark one specific point (at y =100)?
3 次查看(过去 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');
0 个评论
采纳的回答
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
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 Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!