So I've been trying to plot this function as y achses and time t as x achses
t = 0 : 1/100 : 2*pi
u = 300*((exp(-t/(68.2128*10^-6))-(exp(-t/(405*10^-9)))))
but it doesn't seem to give me the correct answer. How can i convert the equation into a code?

 採用された回答

Voss
Voss 2022 年 5 月 1 日

1 投票

I think your expression for u is ok (but note that 68.2128*10^-6 can be written more compactly as 68.2128e-6, etc., which allows you to use fewer parentheses). The only problem is the choice of t over which to calculate u.
t = 0 : 1e-6 : 4e-4;
u = 300*(exp(-t/68.2128e-6)-exp(-t/405e-9));
plot(t,u)

2 件のコメント

MatlabUser
MatlabUser 2022 年 5 月 1 日
Perfect! it worked. Thanks!
Image Analyst
Image Analyst 2022 年 5 月 1 日
A good way to thank is to click the "Accept this answer" link to award the answerer with "Reputation points." Thanks in advance. 🙂

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2022 年 5 月 1 日

コメント済み:

2022 年 5 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by