Sketching function for V(t)

How do I sketch this function v(t)=10e^(-4t)cos(40pit/5) to output a list of times and corresponding voltages? The plot should be for 0<t<5T where T is the time constant for the exp component

回答 (2 件)

Star Strider
Star Strider 2018 年 1 月 27 日

0 投票

See the documentation on Anonymous Functions (link) to understand how to code your function. You will also need the linspace function.

3 件のコメント

Austin Haha
Austin Haha 2018 年 1 月 27 日
I can't figure it out. Can you please give me the code for it
Jan
Jan 2018 年 1 月 27 日
@Austin: It would be helpful, if you post the code you have tried so far. Then the readers could tell you how to improve the code.
Star Strider
Star Strider 2018 年 1 月 27 日
@Austin Haha —
I believe that you can figure it out. However since Jan Simon already posted his complete solution, I’ll post mine:
v = @(t) 10*exp(-4*t) .* cos(40*pi*t/5);
t = linspace(0, 5/4);
figure(1)
plot(t, v(t))
grid
NOTE The time constant is (1/4), so the time for the simulation goes from 0 to (5/4), as in the linspace call defining ‘t’ in my code.

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

Jan
Jan 2018 年 1 月 27 日

0 投票

T = 0.2;
t = linspace(0, 5*T, 200);
v = 10 * exp(-4*t) .* cos(8 * pi * t);
plot(t, v)

カテゴリ

タグ

質問済み:

2018 年 1 月 27 日

コメント済み:

2018 年 1 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by