Professional Documents
Culture Documents
INTERPOLATION
Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
OUTPUT ........................................................................................................................... 1
SOLVER ........................................................................................................................... 1
INPUT
SC_LGI([1 1.2 1.3 1.5],[1 1.0954 1.1402 1.2247],1.1)
n=length(y);
pr=1;
sum=0;
for i=1:n
for j=1:n
if i~=j
pr=pr*((yn-y*j)/(y*i-y*j));
end
end
sum=sum+pr*x(i);
pr=1;
end
fprintf('The Value is %f\n',sum)
OUTPUT
The Value is 0.994024
SOLVER
interp1([1 1.2 1.3 1.5],[1 1.0954 1.1402 1.2247],1.1)
1
INVERSE LAGRANGES
INTERPOLATION
ans = 0.994024