You are on page 1of 2

INVERSE LAGRANGES

INTERPOLATION
Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
OUTPUT ........................................................................................................................... 1
SOLVER ........................................................................................................................... 1

Name of the Student:Shubham Chapparghare Roll No:351013

INPUT
SC_LGI([1 1.2 1.3 1.5],[1 1.0954 1.1402 1.2247],1.1)

PROGRAM & RESULT


function[]=SC_LGI(x,y,yn)

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)

The Value is 0.994024

OUTPUT
The Value is 0.994024

Undefined function 'The' for input arguments of type 'char'.

Error in SC_LGI (line 22)


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

Published with MATLAB® R2017a

You might also like