Help with Matlab Problem: Maclaurin Series

  • Context: MATLAB 
  • Thread starter Thread starter yazankinany
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

The discussion focuses on implementing a Maclaurin series in MATLAB to evaluate the cosine function. Users are instructed to create a function named macfun that takes two inputs, n and x, to compute the series. The steps include setting x to π/3, calculating the actual cosine value, estimating it using macfun, and evaluating the percent error against a threshold of 0.001. If the error exceeds this limit, users are advised to increment n and repeat the estimation.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of Maclaurin series and Taylor series expansion
  • Basic knowledge of trigonometric functions, specifically cosine
  • Ability to calculate percent error
NEXT STEPS
  • Implement the macfun function in MATLAB
  • Research MATLAB's built-in functions for error evaluation
  • Explore advanced series approximations for other functions
  • Learn about MATLAB's plotting capabilities to visualize error convergence
USEFUL FOR

Students, educators, and professionals in mathematics or engineering fields who are using MATLAB for numerical analysis and function approximation.

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:
Physics news 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
 

Similar threads

Replies
6
Views
4K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K