u=@(t)(t>=0);
x=@(t)exp(-t).*u(t);
y=@(t)exp(-3*t).*u(t);t=-10:0.01:10;thao=-10:0.01:10;h=zeros(1,length(t));i=1;
for it=t
   plot(thao,x(thao),'b-','linewidth',2)
   %axis([-7 7 -0.3 1.3])
   hold on
   plot(thao,y(it-thao),'g-','linewidth',2)
   %axis([-7 7 -0.3 1.3])
   h(i)=trapz(thao,x(thao).*y(it-thao));
   plot(t,h,'r-','linewidth',2)
   %axis([-7 7 -0.3 1.3])
   hold off
   pause(0.0001)
   i=i+1;
 end

    