plotting discrete time signals

8 ビュー (過去 30 日間)
William
William 2013 年 9 月 11 日
回答済み: aswathy subash 2019 年 5 月 1 日
I'm trying to plot a discrete time signal with a step function from -5 to 5 I am trying to use the heaviside() function but keep getting errors. Can anyone tell me why this is invalid matlab syntax?
n = [-5 -4 -3 -2 -1 0 1 2 3 4 5];
f_one = 2*(0.5)^.n * heaviside(n.+2)

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 11 日
編集済み: Azzi Abdelmalek 2013 年 9 月 11 日
% You have so
n = [-5 -4 -3 -2 -1 0 1 2 3 4 5];
f_one = 2*0.5.^n.* heaviside(n+2)
stem(n,f_one)
% The operator .+ does not exist in Matlab

その他の回答 (2 件)

William
William 2013 年 9 月 11 日
Thanks again for your help! It's been three in a row :) You're awesome!

aswathy  subash
aswathy subash 2019 年 5 月 1 日
matlab program for to sketch magnitude and phase spectrum of discrete time system H(e^jw)=(1-e^(-3jw))/3(1-e(-jw) )

カテゴリ

Help Center および File ExchangeData Import and Network Parameters についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by