How to mark a specific point in matlab plot?

14 views (last 30 days)
Hello,
I'm trying to mark a specific point on the curves when y = 0. Because I want to know the value of x when y = 0.
but I didn't succeed....
x = 0:0.01:66.03;
y=(3.7*(10*(x/66.03).^3-15*(x/66.03).^4+6*(x/66.03).^5)-1.86);
plot(x,y,'c-','LineWidth',3);
y1=0;
x1=interp1(x,y,y);
hold on;
semilogy(x1,y1,'*r')
Any idea on how to fix the problem?
Thank you in advance for your help!

Accepted Answer

Voss
Voss on 10 Apr 2022
To interpolate to find a value of x for a given value of y, treat y as the independent variable and x as dependent on y.
x = 0:0.01:66.03;
y=(3.7*(10*(x/66.03).^3-15*(x/66.03).^4+6*(x/66.03).^5)-1.86);
plot(x,y,'c-','LineWidth',3);
y1=0;
% x1=interp1(x,y,y);
x1=interp1(y,x,y1); % given x(y), find x(y1)
hold on;
semilogy(x1,y1,'*r')

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!