Member of the approximation and the resampling classes.
y2 = interp1(y1, x2)
y2 = interp1(x1, y1, x2)
y2 = interp1(x1, y1, x2, method)
Interpolates y-values based on sample data using a specified method.
| Name | Description | ||||||||
| y1 | Specifies the sample y-values. If y1 is a matrix, LabVIEW performs interpolation for each column in the matrix. y1 is a real, double-precision vector or matrix. | ||||||||
| x2 | Specifies the x-values at which you want to interpolate y-values. x2 is a real, double-precision vector. | ||||||||
| x1 | Specifies the sample x-values. If you do not specify x1, LabVIEW sets x1 to the values of 0 ... length(y1) - 1. If x1 is a matrix, LabVIEW performs interpolation for each column in the matrix. x1 is a real, double-precision vector or matrix. | ||||||||
| method | Specifies the interpolation method to use. method is a string that accepts the following values.
|
| Name | Description |
| y2 | Returns the y-values interpolated at the values of x2. y2 is a real, double-precision vector. |
X1 = -4:0.5:4;
Y1 = 1.02*X1.^3+0.5*X1.^2+2;
X2 = -4:0.1:4;
Y2 = interp1(X1, Y1, X2, 'spline')