Code not working?

7 ビュー (過去 30 日間)
Catherine Mohs
Catherine Mohs 2019 年 1 月 31 日
コメント済み: Catherine Mohs 2019 年 1 月 31 日
I keep getting an error when I run this code. What am I doing wrong?
t=[0:2:100];
height=2.13*t.^2-0.0013*t.^4+0.000034*t.^4.751;
max_height=max(height)
time_max_height=t(max_height)

採用された回答

madhan ravi
madhan ravi 2019 年 1 月 31 日
[max_height,idx]=max(height);
% ^^^---- gives the index , you were rying to index with value instead of true index
time_max_height=t(idx)
  1 件のコメント
Catherine Mohs
Catherine Mohs 2019 年 1 月 31 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by