%time Reversal (Or) Folding Operation On Unit Step Function: For If
%time Reversal (Or) Folding Operation On Unit Step Function: For If
cc
t = -3:0.001:3;
x = zeros(1,length(t));
for i = 1:length(t);
if t(i)>=0
x(i) = 1;
else
x(i) = 0;
end
end
x1 = zeros(1,length(t));
for i = 1:length(t);
if t(i)<=0
x1(i) = 1;
else
x1(i) = 0;
end
end
subplot(2,1,1)
plot(t,x)
grid
xlabel('Time - t')
ylabel('amplitude')
title('unit step signal u(t) - 21075A1008')
axis([-3.5 3.5 -1.2 1.2])
subplot(2,1,2)
plot(t,x1)
grid
xlabel('Time - t')
ylabel('amplitude')
title('Folded unitstep signal -u(t) - 21075A1008')
axis([-3.5 3.5 -1.2 1.2])
1
Published with MATLAB® R2020a