clear all
clf
end1=6;
t=linspace(-end1,end1,1024);
%
%x=rect(t);
%x=sinc(t);
x=exp(-t).*unitstep(t);
%
%y=rect(-4*t+2);
%y=sinc(2*t-3);
y=exp(-(-t+2)).*unitstep(-t+2);
%
amin=min(t);
amax=max(t);
omin=min(x)-0.5;
omax=max(x)+0.5;
set(0,'defaultaxesfontsize',20);
figure(1)
plot(t,x,'Linewidth',3)
hold on
plot(t,y,'r','Linewidth',3)
set(gca,'XTick',[-end1:end1])
legend('original x(t)','y(t): transform time-variable')
axis([amin amax omin omax]);
grid
xlabel('Time(s)'), ylabel('Signal Amplitude')
title('Original x(t)')
hold off
%
%y=sinc(2*t-2);
%
%y=0.5*exp(-(4-2*t)).*(1+sign(4-2*t));
%
%
figure(2)
plot(t,y,'r','Linewidth',3)
axis([amin amax omin omax]);
grid
xlabel('Time(s)'), ylabel('Signal Amplitude')
title('y(t): transformation of time-variable')
