URGENT It should begin with ddmaxerr pa3f1 Here is the mydi

URGENT!

It should begin with [dd,maxerr] = pa3f1()

%Here is the my_divd function..

function f = my_divdif(n,x,f)

% function f = my_divdif(n,x,f)

% Computes diagonal of divided difference table

% Inputs:

% n = order of table (needs n+1 interpolation points & values)

% x = vector of interpolation points

% f = vector of function values

for i = 1:n

for j = (n+1):-1:(i+1)

f(j) = (f(j)-f(j-1)) / (x(j)-x(j-i));

end

end

%Here is the other one needed

function p = my_interp(n,d,x,t)

% function p = my_interp(n,d,x,t)

% Computes value of interpolating polynomial at t

% Inputs:

% n = order of polynomial

% d = diagonal of divided difference table (returned by my_divdif)

% x = vector of interpolation points

% t = where we want to evaluate the interpolating polynomial

p = d(n+1);

for k = n:-1:1

p = d(k) + (t-x(k)).*p;

end

should be done with 5 equally spaced interpolation points in [0,1], and the maximum error should be computed using 101 equally spaced points in the interval [0,1].

Solution

This is related to computer programming. please write a problem so that I can help

URGENT! It should begin with [dd,maxerr] = pa3f1() %Here is the my_divd function.. function f = my_divdif(n,x,f) % function f = my_divdif(n,x,f) % Computes diag

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site