[go: up one dir, main page]

0% found this document useful (0 votes)
34 views1 page

Langranges Interpolation: Input Program & Result

Uploaded by

YASH DOSHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Langranges Interpolation: Input Program & Result

Uploaded by

YASH DOSHI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

LANGRANGES INTERPOLATION

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

Name : Shubham Chapparghare


Roll no. : 351013

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

PROGRAM & RESULT


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

n=length(x);
yr=0;
for i=1:n
l=1;
for j=1:n
if i~=j
l=l*((xr-x(j))/(x(i)-x(j)));
end
end
yr=yr+y(i)*l;
end
fprintf('The value of the given function is %f\n',yr);

The value of the given function is 1.048713

OUTPUT
The value of the given function is 1.048713

SOLVER
• interp1([1 1.2 1.3 1.5],[1 1.0954 1.1402 1.2247],1.1)

• ans = 1.0477

Published with MATLAB® R2017a

You might also like