Interpolation is the process of finding the values between the data points.
The function used to find the interpolation is interp1
For example we have values as shown in the table below
In the MATLAB X and Y shall be defined as follows
x=2:6
y=[66 ,69 , 80, 87, 65]
Using Interpolation we have to find the value of the y at x=4.6
We can perform that task in MATLAB as follows.
x_4p6= interp1(x,y,4.5)
We get answer in the MATLAB as
x_4p6 =
83.5000
The function used to find the interpolation is interp1
For example we have values as shown in the table below
X
|
Y
|
2
|
66
|
3
|
69
|
4
|
80
|
5
|
87
|
6
|
65
|
In the MATLAB X and Y shall be defined as follows
x=2:6
y=[66 ,69 , 80, 87, 65]
Using Interpolation we have to find the value of the y at x=4.6
We can perform that task in MATLAB as follows.
x_4p6= interp1(x,y,4.5)
We get answer in the MATLAB as
x_4p6 =
83.5000
Comments
Post a Comment