Some help to find the max value of a function?

Hi,
I don't know the code to put in the EDITOR to find the maximum value of a function.
My EDITOR:
%Function i=@(t,y) [y(3); y(4); (-xg0*w0^2*sin(wf*t)*M-w0^2*y(1)*M-2*w0*beta*y(3)*M)/M; 0]; [Ti,Yi]= ode45(i,[0 50],[0 0 0 0]);
%Plot function plot(Ti,Yi(:,1));
%Find max value of the function ?

 채택된 답변

Honglei Chen
Honglei Chen 2012년 2월 15일

0 개 추천

Why not use max, e.g.,
max(Yi(:,1))
For details, see the documentation
doc max

댓글 수: 2

Igor
Igor 2012년 2월 15일
It works, thank's ;)
why not zoidberg?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

태그

질문:

2012년 2월 15일

댓글:

2017년 12월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by