[t,y] = ode45(@(t,y) cos(t.^2), [0.9 55], 0); figure plot(t,y,'-ob') [~,p]=max(y); hold on plot(t(p),y(p),'r*') hold off fprintf('massimo è y=%0.4f con t=%0.4f \n',y(p),t(p))
[t,y] = ode45(@(t,y) cos(t.^2), [0.9 55], 0); [~,w] = findpeaks(y); figure plot(t,y,'-b') hold on plot(t(w),y(w),'*r') fprintf(' ha %i massimi locali \n',length(w))