Some help to find the max value of a function?

1 回表示 (過去 30 日間)
Igor
Igor 2012 年 2 月 15 日
コメント済み: Tornike Onoprishvili 2017 年 12 月 28 日
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 日
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 ;)
Tornike Onoprishvili
Tornike Onoprishvili 2017 年 12 月 28 日
why not zoidberg?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDesktop についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by