Interpolate 2D Scattered VI

Owning Palette: Interpolation & Extrapolation VIs

Requires: Full Development System

Performs two-dimensional interpolation on scattered points.

This VI accepts X, Y, and Z values (two independent variables and one dependent variable, respectively) and returns interpolated values Zi that correspond to each Xi and Yi location.

You must manually select the polymorphic instance to use.

Example

Use the pull-down menu to select an instance of this VI.

 Add to the block diagram  Find on the palette

Interpolate 2D Scattered (1D)

method sets the interpolation method.

0nearest—Performs interpolation on the nearest points (non-smooth). This method finds the point closest to (Xi, Yi) and assigns the corresponding value in Z to Zi.
1linear (default)—Performs linear interpolation on the selected triangle (non-smooth). This method triangulates the convex hull of (X, Y) and interpolates Zi for the points inside a triangle.

(Xi, Yi) is valid only inside the convex hull of (X, Y). Otherwise, LabVIEW returns NaN.
2cubic—Performs cubic interpolation on the selected triangle (smooth). This method triangulates the convex hull of (X, Y) and interpolates Zi for the points inside a triangle.

(Xi, Yi) is valid only inside the convex hull of (X, Y). Otherwise, LabVIEW returns NaN.
3biharmonic spline—Performs biharmonic spline interpolation (smooth). This method calculates 2D biharmonic spline interpolation using Green�s function.

Refer to A Practical Guide to Splines in the Mathematics Related Documentation topic for more information about the biharmonic spline interpolation method.
Z is the value of the known points.
X is the x-coordinates of the known points.
Y is the y-coordinates of the known points. X, Y, and Z must be the same size.
Xi is the x-coordinates of the new points where the VI computes interpolated values at Zi.
Yi is the y-coordinates of the new points where interpolated values compute at Yi.

The size of Yi must equal the size of Xi.
Zi returns the interpolated values of the new points that correspond to the Xi and Yi values.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Interpolate 2D Scattered (2D)

method sets the interpolation method.

0nearest—Performs interpolation on the nearest points (non-smooth). This method finds the point closest to (Xi, Yi) and assigns the corresponding value in Z to Zi.
1linear (default)—Performs linear interpolation on the selected triangle (non-smooth). This method triangulates the convex hull of (X, Y) and interpolates Zi for the points inside a triangle.

(Xi, Yi) is valid only inside the convex hull of (X, Y). Otherwise, LabVIEW returns NaN.
2cubic—Performs cubic interpolation on the selected triangle (smooth). This method triangulates the convex hull of (X, Y) and interpolates Zi for the points inside a triangle.

(Xi, Yi) is valid only inside the convex hull of (X, Y). Otherwise, LabVIEW returns NaN.
3biharmonic spline—Performs biharmonic spline interpolation (smooth). This method calculates 2D biharmonic spline interpolation using Green�s function.

Refer to A Practical Guide to Splines in the Mathematics Related Documentation topic for more information about the biharmonic spline interpolation method.
Z is the value of the known points.
X is the x-coordinates of the known points.
Y is the y-coordinates of the known points. X, Y, and Z must be the same size.
Xi is a 2D array of the corresponding values of X. Both sets of corresponding interpolated values compute the dependent variable Zi.
Yi is a 2D array of the corresponding values of Y. Both sets of corresponding interpolated values compute the dependent variable Zi.

The size of Yi must equal the size of Xi.
Zi is the 2D array of interpolated values that correspond to the Xi and Yi independent variable values.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Example

Refer to the Scattered 2D Interpolation VI in the labview\examples\Mathematics\Interpolation directory for an example of using the Interpolate 2D Scattered VI.

 Open example  Find related examples