Unit Step Signal | Scigyan

Unit Step Signal

Matlab program to generate Unit Step Sequence/Signal in discrete and continuous form.

Matlab code

clc;
clear all;close all;
n=input('Enter the length of the Unit Step Sequence N=');
t=0:n-1; % defines the time axis
u=ones(1,n); % defines an 1 x n matrix which is filled with ones
subplot(2,1,1);
plot(t,u);
axis([0 n+5 -2 2]);
ylabel('u(t)');
xlabel('Time->');
title('Graph for Unit Step Sequence [Continuous form]'); grid;
subplot(2,1,2);
stem(t,u);
axis([0 n+5 -2 2]);
ylabel('u[t]');
xlabel('Time->');
title('Graph for Unit Step Sequence [Discrete form]');

Command window

Enter the length of the Unit Step Sequence N=15.

Figure window

Unit-Step-Signal
No comments:
Post a Comment

Related Posts Plugin for WordPress, Blogger...