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 Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

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