Tuesday, 15 May 2012

Write a MATLAB program to generate a discrete time unit step sequence.(take time index value 0 to 20 ). Modify this program the delayed sequence(let delay =10 unit on time axis). Again modify it for amplitude of 2 unit.


close all;
clc;


t=0:1:19;
axis([0,3,0,30]);
y1=ones(1,20); %unit step 
subplot(2,2,1);
axis([0,3,0,30]);
plot(t,y1);
title('unit step function');
xlabel(' time ');
ylabel(' unit function ');
y2=ones(1,10); %unit step 


subplot(2,2,2);


plot(10:1:19,y2);
title('unit step function');
xlabel(' time ');
ylabel(' unit function ');


y3=2*ones(1,20); %unit step 
subplot(2,2,3);
plot(t,y3);
title('unit step function');
xlabel(' time ');
ylabel(' unit function ');
y2=2*ones(1,10); %unit step 


subplot(2,2,4);


plot(10:1:19,y2);
title('unit step function');
xlabel(' time ');
ylabel(' unit function ');

0 comments

 
© 2011-2012 ProgrammingBlue
Posts RSS Comments RSS
Back to top