Demo entry 5958959

MATLAB

   

Submitted by Liu on Sep 09, 2016 at 03:58
Language: Matlab. Code size: 296 Bytes.

x=0:0.01:10;
y=sin(x);
y1=x;
y2=x-x.^3/factorial(3);
y3=x-x.^3/factorial(3)+x.^5/factorial(5);
y4=x-x.^3/factorial(3)+x.^5/factorial(5)-x.^7/factorial(7);
plot(x,y,x,y1,x,y2,x,y3,x,y4);
axis([0,10,-5,5]);
legend('y=sinx','y=x','y=x-x^3/3!','y=x-x^3/3!+x^5/5!','y=x-x^3/3!+x^5/5!-x^7/7!');

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).