小弟最近刚学MATLAB
要求方程式极值并标示在图上
clear
for i =0:6000;
t=i*0.001;
y=0.2*t.^6-4*t.^5+31.2*t.^4-119.6*t.^3+232.6*t.^2-212.2*t+70;
plot(t,y)
set(gca,'ytick',[-6 -4 -2 0 2 4 6 8 10]);
axis([0, 6, -6, 10]);
grid on;
hold on;
end;
t=0:1:6;
y=0.2*t.^6-4*t.^5+31.2*t.^4-119.6*t.^3+232.6*t.^2-212.2*t+70;
n=length(t);
for ii=1:n;
for jj=ii+1:n;
if y(ii) < y(jj);
temp=y(jj);
plot(temp,'bo');
hold on;
end
end
end
图有跑出来但极值没有出来
请问是哪里写错