%
% Example 2.11 and Figure 2.16
%
% continuous-time unit step
t1=-10:0; t2=0:10; t=[t1 t2];
% semicolon suppresses printing to screen/paper
u=[zeros(1,11) ones(1,11)];
subplot(221); plot(t,u); axis([-10 10 -0.5 1.5]); grid
title('unit step'); xlabel('time t'); ylabel('u(t)')
%
% continuous-time rectangular pulse
t1=-10:-3; t2=-3:3; t3=3:10; t=[t1 t2 t3]
p6=[zeros(1,8) ones(1,7) zeros(1,8)]
subplot(222); plot(t,p6); axis([-10 10 -0.5 1.5]); grid
title('rectangular pulse'); xlabel('time t');
ylabel('p6(t)')
%
% continuous-time ramp signal
t1=-10:-1; t2=0:10; t=[t1 t2]
r=[zeros(1,10) t2]
subplot(223); plot(t,r); grid
title('unit ramp'); xlabel('time t'); ylabel('r(t)')
%
% continuous-time triangular pulse
t1=-10:-3; t2=-2:0; t3=0:2; t4=3:10; t=[t1 t2 t3 t4]
tri4=[zeros(1,8) 1+0.5*t2 1-0.5*t3 zeros(1,8)]
subplot(224); plot(t,tri4); axis([-10 10 -1 2]); grid
title('triangular pulse'); xlabel('time t');
ylabel('tri4(t)')
print -deps fig2_16.eps
