x=[-2:0.01:4]; y=3*x.^3-26*x+10; yd=9*x.^2-26; ydd=18*x; % plot(x,y,'-b') % plot(x,yd,'--r') % plot(x,ydd,':k') plot(x,y,'-b',x,yd,'--r',x,ydd,':k') grid on figure, subplot(221), plot(x,y,'r') grid on subplot(222), plot(x,yd,'b') grid on subplot(223), plot(x,ydd,'k') grid on subplot(224), plot(x,y,'r',x,yd,'b',x,ydd,'k') grid on