Help with Matlab Problem: Maclaurin Series

  • MATLAB
  • Thread starter yazankinany
  • Start date
  • Tags
    Matlab
In summary, the person needs help with a Maclaurin series question in Matlab. The solution involves creating a function called macfun and evaluating it with different values of n and x. The goal is to find a value of n that results in a percent error of less than 0.001.
  • #1
yazankinany
2
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
  • #2


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


thank you very much, I really appreciate it
 

FAQ: Help with Matlab Problem: Maclaurin Series

1. What is a Maclaurin series?

A Maclaurin series is a special type of power series representation of a function, used to approximate a function around the point x = 0. It is named after the Scottish mathematician Colin Maclaurin.

2. Why is the Maclaurin series important in Matlab?

The Maclaurin series is important in Matlab because it allows for the approximation of complex functions using a simpler polynomial expression. This can be useful for solving problems in mathematics, engineering, and other sciences.

3. How do I find the Maclaurin series for a specific function in Matlab?

In Matlab, you can use the taylor function to find the Maclaurin series for a given function. This function takes in the function, the number of terms in the series, and the variable for expansion as inputs and returns the Maclaurin series as an output.

4. What is the order of a Maclaurin series?

The order of a Maclaurin series is the highest power of the variable in the series. For example, the Maclaurin series for sin(x) would have an order of infinity because it contains all powers of x.

5. Can I use a Maclaurin series to find the value of a function at a specific point?

Yes, you can use a Maclaurin series to approximate the value of a function at a specific point. This is done by plugging in the desired value of the variable into the Maclaurin series expression and evaluating the resulting polynomial expression.

Similar threads

Replies
32
Views
3K
Replies
1
Views
1K
Replies
1
Views
1K
Replies
2
Views
3K
Replies
1
Views
1K
Replies
5
Views
2K
Back
Top