A MATLAB Program To Generate A Unit Step Signal

%unit step signal generation
%n denote the range of input
%y here is output
n=[-10:10]
y=ones(1,21)
y=zeros(1,10)
y=ones(1,11)
y=[zeros(1,10) ones(1,11)]
stem(n,y)



IN the above created program in MATLAB editor ,to generate the unit step sequence i first specified the range of n.Then the output y is obtained by appending the 2 vectors which are zeros(1,10) and ones(1,11).
By using the stem(n,y),the each of output value is plotted against each value of input range specified as a vector that is stored in n.

Popular posts from this blog

Shutdown Pc

Ellipse using OpenGl

String Comparisons