Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Matlab. I was able to do part B, but I\'m not sure how to simplify that further

ID: 3111518 • Letter: M

Question


Matlab. I was able to do part B, but I'm not sure how to simplify that further for part C or find the value of error.

This is the code I started with:

function y=nest(d,c,x,b)
If nargin<4, b=zeros (d,1); end
y=c(d+1);
for i=d: -1: 1
   y=y.*(x-b(i))+c(i);
end

val 4.6250 10 Consider the polynonial P(r) = 1 2 , 1. .. rom ,reo (b) Uise nest.m to evaluate P(L.01) (c) Find a simpler way to exprss P(ex) and it to evaluate P(LO) int: Use the fact thata (d) Estimate the aleolute vahwof the ..rror of t " isested maltiplication Hand in a printont of the adjusted nest.m program, as well as a printont of all relevant commands in your conmanid window

Explanation / Answer

The following code will give the sum of the series,

function [ sum ] = nest1( a,n )
sum=0;
for k=0:n
sum=sum+((1-a^(k+1))/(1-a));
end

For finding out the absolute error, just take the difference of the two computed sum, i.e,

sum by nest.m and sum by nest1.m, take the absolute difference. |value by nest.m-value by nest1.m|