Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

% Generation of unitstep function

cc

t = -3:0.01:3;
x = zeros(1,length(t));

for i = 1:length(t)
if t(i)>=0;
x(i)=1;
else
x(i)=0;
end
end

plot(t,x)
grid
xlabel('Time - t')
ylabel('amplitude')
title('unit step-function - 21075A1008')
axis([-3 3 -1.2 1.2])

Published with MATLAB® R2020a

You might also like