clc
t=-3:0.01:5;

x1=heaviside(t);
x2=heaviside(t+1);
x3=heaviside(t-1);
x4=heaviside(t-2);

a=(x2-x1).*(t^2);
b=x3.*(x1-x3);
c=-1*(x3-x4);

total=a+b+c;
plot(tf)