By using syntax ‘taylor’ in MATLAB, find the third order approximation of log x using base point at x = 1.
4 ビュー (過去 30 日間)
古いコメントを表示
syms x
f = logx;
T = taylor(f, 'Order', 3)
Undefined function or variable 'logx'.
How can i do that above question? I have tried but i was unable to generate
11 件のコメント
Torsten
2018 年 9 月 13 日
Yes.
But why don't you read the documentation:
https://de.mathworks.com/help/symbolic/taylor.html
?
Your question is almost answered in the section "Specify Expansion Point".
Best wishes
Torsten.
回答 (2 件)
Dongji Lee
2020 年 11 月 8 日
Or you can type it in simple manner.
T = taylor(f,x,1,'Order', 3)
0 件のコメント
John D'Errico
2018 年 11 月 12 日
Hint: MATLAB does not know that when you type logx, in fact you wanted it to compute the function log(x). As well, you need to understand that a Taylor series of log(x) around the default expansion point of x==0 will be a serious problem. If you don't know why, then go back to calc 101.
So your code should start like this:
syms x
f = log(x);
T = taylor(f, 'Order', 3,'expansionpoint',1)
Which works nicely.
T =
x - (x - 1)^2/2 - 1
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!