plot discrete time domain signals
显示 更早的评论
Given n=[-1:0.01:10]. Plot the discrete time domain signal: y[n]=e^(-n)*u(n).
Below is my program but i'm not sure if it's correct since this is my fisrt time learning Matlab. Please help. Thanks!
n=-1:0.01:10;
y=exp(-n).*heaviside(n);
stem(t,y)

1 个评论
Be careful using heaviside for u[n]. In control systems and signal processing the function u[n] is the unit step function that is (typically) defined as
u[n] = 1 for n >= 0
u[n] = 0 for n < 0.
However, the default defintion of the heaviside function in Matlab has heaviside(0) = 0.5., which is clearly seen in the plot. Is that the desired answer?
Also, it looks a bit peculiar to have non-integer values of n. Please make sure that's the correct problem statement.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Labels and Styling 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!