using the taylor series function of matlab

Hello,
I am trying to write a piece of code that allows me to input the numbers of terms in a taylor series and I know that i must use the "k = input('numbers of terms')" comand, when I use: (here is my code)
k = input('total number of terms in the taylor series:');
syms x;
taylor(exp(x), x, 'ExpansionPoint', k)
is k the number of terms? and if not how do i set the number of terms to be expressed?
thank you in advance.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 9월 4일

1 개 추천

taylor(exp(x), x, 'Order', k)
Note that this will expand around x=0 unless you provide an expansion point.

댓글 수: 4

SonOfAFather
SonOfAFather 2012년 9월 4일
thank you
so what is the function of 'expantion point'? only to provide x=0
SonOfAFather,
You probably should spend just a few minutes reading:
doc taylor
the result is only correct for small values of x
SonOfAFather
SonOfAFather 2012년 9월 5일
apparently I am completely off base here and don't need to actuallyneed to use the taylor() keyword but need to write a for loop that will actually preform a taylor series for me. sorry that i may have wasted anybodies time with the original question.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by