数值法求解
t=-1:0.001:3;
f1=(heaviside(t)-heaviside(t-1)).*t-(heaviside(t-1)-heaviside(t-2));
f2= fliplr(f1);
fe=(f1+f2).*(1/2);
fo=(f1-f2).*(1/2);
subplot(1,2,1);
plot(t,fe);
line([-3 ,3],[0,0]);
axis([-3 3 -1.5 1.5]);
title('fe');
subplot(1,2,2);
plot(t,fo);
line([-3 ,3],[0,0]);
axis([-1.5 3 -1.5 1.5]);
title('fo');