필터 지우기
필터 지우기

How to find X Value given Y value and show the point on a plot

조회 수: 9 (최근 30일)
Matlab_Student
Matlab_Student 2017년 10월 8일
댓글: Onu Student 2020년 11월 5일
I have an semilog plot below.
%
x = 0:1:25;
y = exp(-0.03*x);
figure;
semilogy(x,y);
%
I want to let the program calculate the x value when y=0.5 and indicate this point (x,0.5) on the plot with dashed lines connecting to the two axes. How do I achieve this?

채택된 답변

KSSV
KSSV 2017년 10월 9일
x = 0:1:25;
y = exp(-0.03*x);
figure;
semilogy(x,y);
%
yi = 0.5 ;
xi = interp1(y,x,yi) ;
hold on
semilogy(xi,yi,'*r')
  댓글 수: 4
Coryn Melissa LLamoza Carabali
Coryn Melissa LLamoza Carabali 2020년 10월 14일
yes! looking for both questions above. Anybody that can help with this ;(
Onu Student
Onu Student 2020년 11월 5일
you can add annotations to plots text(x,y,txt)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by