How to plot u(t) - u(t-2) on matlab

回答 (2 件)

Star Strider
Star Strider 2022 年 12 月 17 日

1 投票

If ‘u(t)’ is the unit step (heaviside) function —
syms t
u(t) = heaviside(t);
figure
fplot(u(t)-u(t-2), [0 5])
grid
xlabel('t')
ylabel('Amplitude')
axis('padded')
.
Torsten
Torsten 2022 年 12 月 17 日

0 投票

u = rand(20,1);
du = u(3:end) - u(1:end-2);
plot(du)

カテゴリ

タグ

質問済み:

2022 年 12 月 17 日

回答済み:

2022 年 12 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by