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

USE MATLAB Newton\'s divided method of interpolation involves finding the coeffi

ID: 3737674 • Letter: U

Question

USE MATLAB

Newton's divided method of interpolation involves finding the coefficients of the formula, bo and b?, given (xo.yo), (xi ,y, ), so that they may formulate fi (x) = bo + bì (x-xo) , where bo = f(%) 2. This is a linear case. For the third order (or the cubic) interpolation, we need to find four coefficients, bo, b1, b2 and b3. The third order polynomial, given (??.yo), (xi.yi), (x2,y2), and (x, y), is Using the table above, build the MATLAB code (Newton's divided method for cubic interpolation). Then, find the missing value of velocity at t-16.

Explanation / Answer

SAVE THE FOLLOWING CODE IN MATLAB AND GET THE RESULTS. THE OUTPPUT RESULTS IS ALSO ATTACHED BELOW-

function TDD = divdiff(X, Y)
% Example:
% TDD = divdiff( [ 1.35 1.37 1.40 1.45 ], [ .1303 .1367 .1461 .1614 ])
if nargin ~= 2
error('divdiff: invalid input parameters');
end
[ p,m]=size(X); % m points, polynomial order <= m-1
if p ~= 1 || p ~=size(Y,1) || m ~= size(Y,2)
error('divdiff: input vectors must have the same dimension');
end
TDD=zeros(m, m);
TDD(:,1)=Y';
for j=2:m
for i=1:(m-j+1)
TDD(i,j)=(TDD(i+1,j-1)-TDD(i,j-1))/(X(i+j-1)-X(i));
end
end
end


Solution of the above with the final values of the coefficients-
After saving the above code in MATLAB, copy and paste the following commands in MATLAB and then hit the enter key—
TDD = divdiff ([1.35 1.37 1.40 1.45], [.1303 .1367 .1461 .1614])
After hitting the enter key-
TDD =

0.1303 0.3200 -0.1333 0.4167
0.1367 0.3133 -0.0917 0
0.1461 0.3060 0 0
0.1614 0 0 0