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

Answers (1)

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

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 14 Apr 2022

Edited:

on 14 Apr 2022

Community Treasure Hunt

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

Start Hunting!