MATLAB: Plot function in matlab

plot symbolic or polynamial function

I want to plot qi=q0+3*(qf-q0)*t^2-2*(qf-q0)*t^3 as defined in the picture.i use plot or ez plot but the figure that is drawn is not correct.
q0=10(degree)
qf=-20(degree)
t=0 to 1 second

Best Answer

q_o=10;
qf=-20;
t=0:.1:1;
qi=q_o+3*(qf-q_o)*t.^2-2*(qf-q_o)*t.^3;
plot(t,qi);
title('Cubic Polynomial Trajectory');
xlabel('Time(sec)'); ylabel('Angle(deg)');