Help with Matlab Problem: Maclaurin Series

  • Context: MATLAB 
  • Thread starter Thread starter yazankinany
  • Start date Start date
  • Tags Tags
    Matlab
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
yazankinany
Messages
2
Reaction score
0
Help in Matlab problem!

Hello guys, I really need your help in this question, it's a maclaurin series and I don't know how to do it in matlab. here is the question :
http://sphotos-a.ak.fbcdn.net/hphotos-ak-snc6/734976_2640341944275_792908261_n.jpg

I hope that you can help me ASAP :(
 
Last edited by a moderator:
on Phys.org


well...

you first implement a function, macfun, that implements and evaluates the Maclaurin series for given values of n and x (these two would be the input arguments to the function).

then

1.- you set x = π/3, then
2.- you set xactual = cos(x)
3.- then, you pick a value for n, say 1 or 2, and
4.- set xest to the value of the function macfun(n,x)
5.- then you evaluate the percent error with the formula provided and see if it is less than 0.001...

...if not, increase n by 1 and go back to step 4
 


thank you very much, I really appreciate it