By using syntax ‘taylor’ in MATLAB, find the third order approximation of log x using base point at x = 1.
조회 수: 5 (최근 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개)
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!