Help writing and solving a problem

I'm having a hard time with this problem regarding ideal diode and voltage. I am given the voltage across load
VL=
vs if vs > 0 | 0 if vs <=0
Supply voltage is given by:
vs(t) = 3e^(-t/3)sin(pi*t)
I have to plot VL versus t for 0 <= t <= 10
I've tried using a for loop but I can't get it figured out.
Can someone help?

 採用された回答

Walter Roberson
Walter Roberson 2012 年 4 月 1 日

0 投票

VL = vs;
VL(vs < 0) = 0;

3 件のコメント

Steven
Steven 2012 年 4 月 1 日
I'm confused though cause any number from 0 to 10 you plug into the vs equation it turns out to be 0. How would I write this up
Walter Roberson
Walter Roberson 2012 年 4 月 1 日
That's because you are using only integer t . sin(pi times an integer) is always 0.
Steven
Steven 2012 年 4 月 1 日
So wouldnt the plot just be a straight line at 0?

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

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by