hongyangqin / HyNote

HyNote 个人笔记
8 stars 4 forks source link

[Matlab]Taylor 展开并求值 #38

Open hongyangqin opened 7 years ago

hongyangqin commented 7 years ago

解决办法

taylor 展开

syms x;
y = taylor(tanh(x), x, 'ExpansionPoint', 0, 'Order', 8)

方法1:subs执行

y = taylor(tanh(x));
subs(y, x, '1')
% subs(公式,符号,值)

方法2:eval执行

x = 1;%对应变量赋值
ans = eval(y);%执行