Can anyone create a matlab function for solving the following in the image? My p
ID: 3590590 • Letter: C
Question
Can anyone create a matlab function for solving the following in the image? My professor wants for us to solve by creating functions to just change variables instead of doing it by hand. A script works just as well, thanks!! :)
This problem is Chapra 4.13 in the Applied Numerical Methods with Matlab 3rd Ed
4.13 Use zero- through third-order Taylor to predict f(3) for series expansions fx) 25x3x2+7x-88 using a base point at x = 1 . Compute the true percent relative error er for each approximation.Explanation / Answer
function y= taylor(t,n)
syms x
q= 25 * x^3 - 6 * x^2 + 7 * x - 88
ans= 0*q;
for i=0:n
b=subs(q,x,t);
ans=ans+ b* (t-1)^i / factorial(i);
q=diff(q);
end
y=ans;
end
here t is your input value and n your desired degree.
you get the output value of taylor series from which you can further compute the error .
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.