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');
Phat Nguyen
Phat Nguyen 2021년 6월 3일
Yes, that's great... thank you very much!
Hope you have a nice week <3

댓글을 달려면 로그인하십시오.

추가 답변 (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