You are on page 1of 2

Newton's Forward

Difference Interpolation

Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
Output ............................................................................................................................... 1
Solver ............................................................................................................................... 2

Name : Shubham Chapparghare Roll no.: 351013

INPUT
SC_NFD([100 150 200 250 300 350 400],[10.63 13.03 15.04 16.81 18.42 19.90 21.27],160)

PROGRAM & RESULT


function[]=SC_NFD(x,y,xr)

n=length(x);
for j=1:n-1
for i=1:n-j
if j==1
del(i,j)=y(i+1)-y(i);
else
del(i,j)=del(i+1,j-1)-del(i,j-1);
end
end
end
h=x(2)-x(1);
u=(xr-x(1))/h;
term=0;
for j=1:n-1
mult=1;
for k=1:j
mult=mult*(u-(k-1));
end
term=term+del(i,j)*mult/factorial(j);
end
yr=y(1)+term;
fprintf('The answer is %f\n',yr);

Output
The answer is 13.457333

1
Newton's Forward Dif-
ference Interpolation

Solver
• interp1([100 150 200 250 300 350 400],[10.63 13.03 15.04 16.81 18.42 19.90 21.27],160)

• ans =13.4320

Published with MATLAB® R2017a

You might also like