How to mark a specific point in matlab plot?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Voss
le 10 Avr 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')
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
