How to mark a specific point in matlab plot?
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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!
0 Commenti
Risposta accettata
Voss
il 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')
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
