# Help in Matlab problem !

1. Dec 29, 2012

### yazankinany

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 [Broken]

I hope that you can help me ASAP :(

Last edited by a moderator: May 6, 2017
2. Dec 29, 2012

### gsal

Re: Help in Matlab problem!!!!!!

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

3. Dec 29, 2012

### yazankinany

Re: Help in Matlab problem!!!!!!

thank you very much, I really appreciate it