How to indicate the maximum value in the plotted curve in matlab?

15 vues (au cours des 30 derniers jours)
Amy Topaz
Amy Topaz le 14 Avr 2022
Modifié(e) : Matt J le 14 Avr 2022
How to indicate the maximum value of the curve in a plotted curve in matlab

Réponses (1)

Matt J
Matt J le 14 Avr 2022
Modifié(e) : Matt J le 14 Avr 2022
For example;
x=-2:2;
y=-x.^2+2;
[~,i]=max(y);
plot(x,y,x(i),y(i),'o'); legend('Plot','Maximum Point'); axis padded

Catégories

En savoir plus sur 2-D and 3-D Plots 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!

Translated by