clc;
clear;



syms x;
f = sin(x)/x;
xpoint = 2;
ypoint = subs(f, x, xpoint);
T6 = taylor(f, x, xpoint, Order=3);
fp = fplot(f, 'b-');
fp.LineWidth = 3;
hold on;
ft=fplot(T6, 'm--');
ft.LineWidth = 2;
scatter(xpoint, ypoint, 300, "filled", 'r');
hold on;
hold off;
xlim([-4 4]);
grid on;


legend("sin(x)/x", ...
       "approximation of sin(x)/x", ...
       "x=2", Location="northeast")
title("Taylor Series Expansion")






标签: none

评论已关闭