How can I fix this so that it would show all three plots in one plot?
I followed the instruction in this SO answer but didn't work out: https://stackoverflow.com/a/8773571/2414957
figure;
t = -pi:0.01:pi;
a = sin(t);
plot(t, a, 'r', 'DisplayName', 'a'); hold on;
fhat = (21./(8*pi.^10))*(33*pi.^4-3465*pi.^2+31185)*t.^2 +(3750*pi.^4 -30*pi.^6 -34650*pi.^2)*t.^3 +(5*pi^8-765*pi.^6+7425*pi.^4)*t;
plot(t, fhat, 'c', 'DisplayName', 'fhat');
hold on;
p = t - (t.^3)/factorial(3) + (t.^5)/factorial(5);
plot(t, p, 'b', 'DisplayName', 'p');
hold on;
title('Sine plot by sin(t)');
xlabel('t');
ylabel('sin(t)');
legend('show');