Wednesday, July 15, 2009

Unit step sequence for N=20

% Generate an unit step sequence for N=20. Plot discrete values and level it.
% ***************************************************************************

N=20;
xn=ones(1,N);
n=0:1:N-1;
subplot(2,1,1),stem(n,xn);
subplot(2,1,2),plot(n,xn);
xlabel('n');
ylabel('xn');
title('Unit Step Sequence');

No comments: