How to insert data in taylor series?

조회 수: 12(최근 30일)
Byeong Hui
Byeong Hui 2014년 4월 19일
편집: VBBV 2021년 10월 23일
I want to know e(error).
But, I can not insert x and y value into Taylor series.
This is my code.
syms x y z
f = x*y^2;
U=taylor(f,[x,y],[6,11],'order',2');
x = input('What is your x -axis value ?');
y = input('What is your y -axis value ?');
z=x*y^2
e=(U-z)/U*100;
How to insert x and y value into U equation that is result of taylor series?
I want to calculate error at x =5 and y = 10.

답변(2개)

Walter Roberson
Walter Roberson 2014년 4월 19일
subs(e, {x, y}, {5, 10})
You would probably want to double() the result.

VBBV
VBBV 2021년 10월 23일
편집: VBBV 2021년 10월 23일
syms x y z
f = x*y^2;
U=taylor(f,[x y],[6 11],'Order',2);
x = input('What is your x -axis value ?');
y = input('What is your y -axis value ?');
UU= subs(U,{x y},{5 10}); % use subs here
z=x*y^2;
zz = subs(z,{x y},{5 10}); % use subs here
E=double((UU-zz)/UU*100)
E = -5.7082
You can modify the code as above, & need to use subs for each symbolic equation first and then subsitute them in final equation e. Application of subs to implicit functions, like e may not work properly

태그

Community Treasure Hunt

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

Start Hunting!

Translated by