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?

 Akzeptierte Antwort

Voss
Voss am 1 Mai 2022

1 Stimme

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 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by