Unable to compute taylor expansion using taylortool
3 次查看(过去 30 天)
显示 更早的评论
Im trying to use taylortool but keep getting "cant compute taylor expansion", and I think it is because my function has decimal points.

If f(x) does not have a decimal point, it works fine, even with fractions like (1/4*x*cos(x)).
0 个评论
采纳的回答
VBBV
2022-12-12
编辑:VBBV
2022-12-12
Since you are using a Edit box to read the function, it returns a string expression
A = 1.176*x*cos(x); % A is variable to read the input function entered
str2sym(A) % convert to string function to symbolic expression and try
An example shown below works fine
syms x
f = 1.176*x*cos(x);
T6 = taylor(f,x)
2 个评论
VBBV
2022-12-12
I think it may be due to the order used for the expression to evaluate the expansion
syms x
f = 1.176*x*cos(x);
T6 = taylor(f,x,'Order',1) % this might be reason
syms x
f = 1.176*x*cos(x);
T6 = taylor(f,x,'Order',2)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!