Taylor series determining the values and errors

2 ビュー (過去 30 日間)
sydney salvador
sydney salvador 2020 年 12 月 18 日
編集済み: KSSV 2020 年 12 月 18 日
Im writing a script to solve
F(x)=exp(x) focused at Xo=3 and f(5)
F(x)=sin(x) focused at Xo = 30 degress and f(157) degrees
and on each series i should get the error by subtracting n=10 from each series
here is my code and my handwritten solution, please explain to me how taylor is properly coded into matlab
syms x
f1=exp(x);
f2=sin(x);
T1=taylor(f1,'Order',5);
T2=taylor(f2,'Order',157);
diff1=taylor(f1,'Order',10);
diff2=taylor(f2,'Order',10);
errors1 = diff1-T1;
errors2 = diff2-T2;
disp(T1)
disp(T2)

回答 (1 件)

KSSV
KSSV 2020 年 12 月 18 日
編集済み: KSSV 2020 年 12 月 18 日
You need to substitute the value of x. Read about subs, double. If T1 is your Taylor series
x = 5 ;
val = double(subs(T1,5)) ;
For sin when you substitute the value, substitute them in radians. Convert degrees to radians.

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by