taylor function is not working

i have matlab 2014b and when i came to get taylor expansion of some functions by writting taylor(sin(x),5,0) the matlab gives error knowing that all other functions works properly thanks in advance

回答 (2 件)

Star Strider
Star Strider 2015 年 2 月 5 日

0 投票

If you want to do a 5th-order Taylor series around an expansion point of 0 in R2014b, this works:
syms x
TSsin5 = taylor(sin(x), x, 'ExpansionPoint',0, 'Order',5)
and produces:
TSsin5 =
- x^3/6 + x
James Tursa
James Tursa 2015 年 2 月 5 日
編集済み: James Tursa 2015 年 2 月 5 日

0 投票

It is complaining about the 5 and 0 arguments, which don't match the expected syntax for calling the taylor function. Is something like this what you are trying to do?
>> syms x
>> taylor(sin(x))
ans =
x^5/120 - x^3/6 + x
>> taylor(sin(x),'Order',10)
ans =
x^9/362880 - x^7/5040 + x^5/120 - x^3/6 + x

カテゴリ

タグ

質問済み:

2015 年 2 月 5 日

編集済み:

2015 年 2 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by