clear,clc
x=0:0.01:2*pi;
y=sin(x);
max_where=find(y==max(y));
plot(x,y);
hold on;
plot(x(max_where),max(y),'ro','linewidth',15);
hold on;
plot(x(find(y==min(y))),min(y),'go','linewidth',15);
函数曲线求最值 并标注最值点
最新推荐文章于 2024-05-17 14:46:48 发布
clear,clc
x=0:0.01:2*pi;
y=sin(x);
max_where=find(y==max(y));
plot(x,y);
hold on;
plot(x(max_where),max(y),'ro','linewidth',15);
hold on;
plot(x(find(y==min(y))),min(y),'go','linewidth',15);