clear
m=1000;
tau=12;
dt=tau/m;
t=dt*(-m/2:m/2-1);

x=(t+1).*(t<=2&t>=-1);
subplot(4,1,1);
plot(t,x);
axis([-6 6 -1 4.5]);
grid on;

%%%% get reflection x(-t)%%%%%%%%%
x2=(-t+1).*(-t<=2&-t>=-1);
subplot(4,1,2);
plot(t,x2);
axis([-6 6 -1 4.5]);

%%%%%%%%%do the shifting by 3,x(t-3)%%%%%%%%%%
i=3;
x3=((t-i)+1).*((t-i)<=2&(t-i)>=-1);
subplot(4,1,3);
plot(t,x3,'r');
axis([-6 6 -1 4.5]);

%%%%%%%%%%%%%%do the scaling by 4 times,x(-4(t-3))%%%%%%%%
x4=(-4*(t-i)+1).*(-4*(t-i)<=2& -4*(t-i)>=-1);
subplot(4,1,4)
plot(t,x4,'g');
axis([-6 6 -1 4.5]);
grid on;

