Download as pdf or txt
Download as pdf or txt
You are on page 1of 146

Name of Assignment: Inverse interpolation

Name of Student: Agrawal Vaibhav Ganesh Roll No:01


Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Mattoo Anandini Roll No:02
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Bagal Kaustubh Shivaji Roll No:03
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Bhalerao Snehal Dnyaneshwar Roll No:04
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Bohara Prakash Birbahadur Roll No:05
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Boraste Mayur Murlidhar Roll No:06
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Borse Vivek Subhash Roll No:07
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Borse Kiran Suresh Roll No:08
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Yadav Chetan Nilesh Roll No:09
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Chavan Vishal Arjun Roll No:10
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Dani Sanket Arun Roll No:11
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Darade Kiran Dilip Roll No:12
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gade Mayuri Sanjay Roll No:13
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gawale Harshal Ashok Roll No:14
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gaikwad Ganesh Daulat Roll No:15
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gangurde Ajinkya Suresh Roll No:16
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Garje Prakash Ashok Roll No:17
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gosavi Prathmesh Prakash Roll No:18
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Hapase Vishal Sunil Roll No:19
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student : Jadhav Geetesh Rajendra Roll No:20
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Waghmare Shubham Gangadhar Roll No:21
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Jadhav Shivraj Kalyanrao Roll No:22
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Jadhav Tejaswini Ashok Roll No:23
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Jawale Hemlata Avinash Roll No:24
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Jha Munnakumar Satyendra Roll No:25
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Kanoje Anil Shivaji Roll No:26
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Kapade Amol Mahesh Roll No:27
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Karwande Avinash Ramdas Roll No:28
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Waghule Shital Ashok Roll No:29
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Khardikar Kedar Sharad Roll No:30
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Koli Dinesh Santosh Roll No:31
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Komu Shirisha Malesh Roll No:32
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Lohar Bhushan Gopaldas Roll No:33
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Magar Abhishek Anand Roll No:34
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Telgote Sumit Sanjay Roll No:35
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Mahajan Dhiraj Ashok Roll No:36
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Mahajan Piyush Rajendra Roll No:37
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Nerkar Avinash Natthu Roll No:38
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Murtadak Dhiraj Dharmaraj Roll No:39
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Pagare Vikas Rajesh Roll No:40
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Patare Praphul Tukaram Roll No:41
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Patil Abhijeet Panditrao Roll No:42
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Patil Neeraj Ravindra Roll No:43
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Pagare Samrat Murlidhar Roll No:44
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Amey Page Roll No:45
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Poonam Pawar Roll No:46
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Vishal DPawar Roll No
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Vishal Pawar Roll No:48
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gokul Pekhale Roll No:49
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Sagar Raut Roll No:50
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Sonali Rede Roll No:51
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Akshay Rokade Roll No:52
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Akash Salunke Roll No:53
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Vaibhav Salunke Roll No:54
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Dhanraj Salve Roll No:55
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Ebrar Shah Roll No:56
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Piyush Shahir Roll No:57
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Sanin Shaikh Roll No:58
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Mayur Shardul Roll No:59
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Apurv Sharma Roll No:60
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Ashutosh Shendge Roll No:61
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Sajan Sherekar Roll No:62
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Dipika Shinde Roll No:63
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Akshay Shirole Roll No:64
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Abhijeet Sonawane Roll No:65
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Shruti Sabale Roll No:66
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Rajaram Teknar Roll No:67
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Aishwarya Varule Roll No:68
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Gaurav Vibhandik Roll No:69
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Pooja Vyavahare Roll No:70
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Sandip Wagh Roll No:71
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Saurabh Warkhede Roll No:72
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000
Name of Assignment: Inverse interpolation
Name of Student: Manoj Kumar Yadav Roll No:73
Session: 2016-17 Date:
Problem 1: Find inverse interpolation for given co-ordinates of set of points. Find x at y=2
x 0 1 2 3
y 0 1 7 3

Solution:

Program
clc;
close all;
close all;
% INVERSE INTERPOLATION
n= input('\n Enter no. of data points (n)=');
for i=1:n
fprintf('\nX(%d)=',i);
x(i)=input('');
fprintf('Y(%d)=',i);
y(i)=input('')
end
yg=input('\n Enter Yg for which Xg is requried =');
xg=0;
for i=1:n
L(i)=1;
for j=1:n
if i~=j
L(i)=L(i)*(yg-y(j))/(y(i)-y(j));
end
end
fprintf('\n L(%d) =%f',i,L(i));
xg=xg+L(i)*x(i);
end
fprintf('\n\n By solver Xg =%f at Yg =%f',xg,yg);

Output:

Enter no. of data points (n)=4

X(1)=0
Y(1)=0

y = 0 1 7 25

X(2)=1
Y(2)=1

y = 0 1 7 25

X(3)=2
Y(3)=7

y = 0 1 7 25
X(4)=3
Y(4)=25

y = 0 1 7 25

Enter Yg for which Xg is requried =16

L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

Problem 2: Solve the above equation with the help of solver.


xg=interp1(y,x,yg);
fprintf('n\n By solver Xg=%d at Yg=%f',xg,yg);
By solver Xg =-2.685714 at Yg =16.000000n
By solver Xg=2.500000e+00 at Yg=16.000000>>
Result:
We get the value of
L(1) =6.942857
L(2) =-9.000000
L(3) =2.857143
L(4) =0.200000

You might also like