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?

 Respuesta aceptada

Voss
Voss el 1 de Mayo de 2022
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 comentarios

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 1 de Mayo de 2022

Comentada:

el 1 de Mayo de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by