用泰勒展开去逼近函数

版权声明:本文为作者原创,如需转载,请征得博主同意,谢谢! https://blog.csdn.net/qq_22828175/article/details/83412895

syms x;
s = taylor(sin(x),‘order’,100);
ezplot(s,[-50,50]);
在这里插入图片描述
syms x;
s = taylor(sin(x),‘order’,10);
ezplot(s,[-6,6]);
在这里插入图片描述
从以上两图可以看出,泰勒级数展开的项数越多,就能在越宽的自变量取值范围内准确地逼近原函数;反之,只能在较窄的自变量范围内逼近函数。所以,若想用泰勒展开去求解离已知点较远的点,则需增加展开的级数。

猜你喜欢

转载自blog.csdn.net/qq_22828175/article/details/83412895