フィルターのクリア

How to find the time for the max height of the rocket. MATLAB

13 ビュー (過去 30 日間)
Matthew Lozancich
Matthew Lozancich 2018 年 1 月 5 日
コメント済み: Walter Roberson 2019 年 10 月 6 日
Hi there! Doing a little final practice and was asked to find the max height and the time of the max height of the rocket. I can't figure out the code for the time.
function rocket
g=9.81;
vi=50;
yi=0;
theta=(pi/3);
t=0:0.1:12;
x=vi*cos(theta)*t;
y=yi+vi*sin(theta)*t-((1/2)*g*(t.^2));
plot(t,y)
Maxheight=max([y(:)])
end

採用された回答

Walter Roberson
Walter Roberson 2018 年 1 月 5 日
[Maxheight, timeindex] = max(y);
Now timeindex tells you which entry in y was maximum, and you can use that index to figure out what the corresponding time was.
  2 件のコメント
Abdullah Albayati
Abdullah Albayati 2019 年 10 月 6 日
how to find the corresponding time was.
Walter Roberson
Walter Roberson 2019 年 10 月 6 日
t(timeindex)

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2018 年 1 月 6 日
See my attached demo for a projectile, which computes just about everything you could possibly think to measure.

カテゴリ

Help Center および File ExchangeAcoustics, Noise and Vibration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by