How can I calculate a formula h(t)=4.0+6​.0te^-0.5t​-4.0e^-0.2​5cos(0.75p​i.t)?

1 回表示 (過去 30 日間)
Keith
Keith 2022 年 9 月 29 日
編集済み: Les Beckham 2022 年 9 月 29 日
Im so confused

採用された回答

Kevin Holly
Kevin Holly 2022 年 9 月 29 日
編集済み: Kevin Holly 2022 年 9 月 29 日
You need to make sure all terms that are multiplied use *. Also replace e with 10^ assuming the e is exponent notation.
t = 1:100;
h = 4.0+6.0*t*10^-0.5-(4*10^-0.25)*cos(0.75*pi*t);
plot(t,h)
  2 件のコメント
Keith
Keith 2022 年 9 月 29 日
Thank you so much!
Les Beckham
Les Beckham 2022 年 9 月 29 日
編集済み: Les Beckham 2022 年 9 月 29 日
I think that the e terms are actually exponentials, like e^-1, rather than exponential notation like 10e-1. So, e^-0.5t, for example, might actually be intended to be exp(-0.5*t). If this is the case the code and resulting plot are as shown below.
@Keith will have to decide which is correct.
t = 0:0.01:100;
h = 4.0 + 6.0*t.*exp(-0.5*t) - 4.0*exp(-0.25*cos(0.75*pi*t));
plot(t, h)
grid on

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeState-Space Control Design and Estimation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by