Advertisement
Guest User

taylor

a guest
Mar 4th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function Taylor(n)
  2. x = linspace (0,2*pi,200);
  3. z = 0;
  4. fact = 1;
  5. z = x;
  6. potencia = x;
  7. signo = 1
  8. for i=3:2:n
  9. fact = i*(i-1)*fact;
  10. potencia = potencia.*x.*x;
  11. signo = signo*(-1);
  12. z =z+signo*potencia/fact;
  13. end
  14.  
  15. plot (x,z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement