scatteredlookup
Parent Section: equations
Syntax
scatteredlookup(x1d, x2d, x3d, fd, x1, x2, x3, extrapolation = linear|nearest)
Description
Use the scatteredlookup
function in the
equations
section to compute an output value by
interpolating the query input value against an unstructured, or scattered, set of data
points. Unlike the tablelookup
function, these data
points do not need to form a table grid. You provide the coordinates of a set of input
data points and the function value at each of these data points. Then, you provide the
coordinates of a query point or points and the
scatteredlookup
function returns the
corresponding interpolated function value by using Delaunay triangulation.
The scatteredlookup
function supports
two-dimensional and three-dimensional lookup. The full syntax is:
scatteredlookup(x1d, x2d, x3d, fd, x1, x2, x3, extrapolation = linear|nearest)
| Data set of input values along the first direction, specified as a one-dimensional array. Specify at least three values for two-dimensional lookup and at least four values for three-dimensional lookup. This is a required argument. |
| Data set of input values along the second direction, specified
as a one-dimensional array of the same size as
|
| Data set of input values along the third direction, specified
as a one-dimensional array of the same size as
|
| Data set of function values for the lookup, specified as a
one-dimensional array of the same size as |
| The query input value along the first direction, specified as a
scalar or as an N-D array. Its units must be commensurate with the
units of |
| The query input value along the second direction, specified as
a scalar or as an N-D array of the same size as
|
| The query input value along the third direction, specified as a
scalar or as an N-D array of the same size as |
| Optional argument that specifies the approximation method for
calculating the output value when the input value is outside the
range specified in the lookup table. The default is
|
The extrapolation
argument values are:
linear
— Linear extrapolation based on boundary gradients.nearest
— Nearest neighbor extrapolation. This method evaluates to the value of the nearest neighbor on the boundary.
If the query input values x1
, x2
, and
x3
are:
Scalar, then the function returns a scalar.
N-D arrays, then the function returns an N-D array of the same size.
Examples
Version History
Introduced in R2023a