Matlab Programs For Elementary Signals: Unit Step Function
Matlab Programs For Elementary Signals: Unit Step Function
Output:
Rectangular Pulse: -
fs=500;
T=0.2;
t=-0.5:1/fs:0.5;
x=rectpuls (t, T);
plot (t, x,'K');
axis ([-0.5 0.5 0 2]);
title ('Rectangular pulse');
xlabel('Time');
ylabel('Amplitude');
Output: -
Output: - 5
Triangular Function: -
t=1:10;
x= [1 0 1 0 1 0 1 0 1 0];
plot (t, x);
title ('Triangular pulse');
xlabel('Time');
ylabel('Amplitude');
Output: -