Results 1 to 2 of 2

Math Help - MATLAB- computer cos(x) using taylor series

  1. #1
    Junior Member
    Joined
    Feb 2008
    Posts
    64

    MATLAB- computer cos(x) using taylor series

    I need to compute using the taylor series but i must also name the function, i have looked around and from what i can understand this is how i thought it needs to be done:

    %x- the argument
    %N the initial number of terms in the expansion
    function[x N]=ty_cos(x,N)
    for x=1:N
    y=feval(taylor(cos(x)))
    end
    end


    either my understanding of this is very wrong or my coding is wrong seeign as it doesnt work, all i need to be able to do, is create the taylor series expansion of cos(x) for the amount of terms N
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Mar 2010
    Posts
    11
    Try to do it symbolically.

    "
    syms x
    syms eps
    y=cos(x);
    T=0;

    for kk=0:10
    x=0;
    T=T+eval(diff(y,kk))*eps^kk/(fac(kk));
    end
    "
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Getting stuck on series - can't develop Taylor series.
    Posted in the Differential Geometry Forum
    Replies: 6
    Last Post: October 5th 2010, 09:32 AM
  2. can Matlab computer the characterisitc polynomial?
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 22nd 2010, 11:26 PM
  3. Replies: 0
    Last Post: January 26th 2010, 09:06 AM
  4. Replies: 9
    Last Post: April 3rd 2008, 06:50 PM
  5. Computer 10th derivative using Mclaurin series
    Posted in the Calculus Forum
    Replies: 1
    Last Post: November 27th 2006, 08:09 PM

Search Tags


/mathhelpforum @mathhelpforum