scatteredInterpolant
Interpolate 2-D or 3-D scattered data
Description
UsescatteredInterpolant
to perform interpolation on a 2-D or 3-D data set ofscattered data.scatteredInterpolant
returns theinterpolantF
for the given data set. You can evaluateF
at a set of query points, such as(xq,yq)
in 2-D, to produce interpolated valuesvq = F(xq,yq)
.
UsegriddedInterpolant
to perform interpolation withgridded data.
Creation
Syntax
Description
creates an empty scattered data interpolant object.F
= scatteredInterpolant
specifies an interpolation method:F
= scatteredInterpolant(___,Method
)'nearest'
,'linear'
, or'natural'
. SpecifyMethod
as the last input argument in any of the first three syntaxes.
specifies both the interpolation and extrapolation methods. PassF
= scatteredInterpolant(___,Method
,ExtrapolationMethod
)Method
andExtrapolationMethod
together as the last two input arguments in any of the first three syntaxes.
Method
can be:'nearest'
,'linear'
, or'natural'
.ExtrapolationMethod
can be:'nearest'
,'linear'
, or'none'
.
Input Arguments
Properties
Usage
Description
UsescatteredInterpolant
to create theinterpolant,F
. Then you can evaluateF
at specific points using any of the following syntaxes:
Vq = F(Pq)
specifies query points in the matrixPq
. Each row inPq
contains the coordinates of a query point.
Vq = F(Xq,Yq)
andVq = F(Xq,Yq,Zq)
specify query points as two or three matrices of equal size.
Vq = F({xq,yq})
andVq = F({xq,yq,zq})
specify query points asgrid vectors. Use this syntax to conserve memory when you want to query a large grid of points.
Examples
More About
Tips
It is quicker to evaluate a
scatteredInterpolant
objectF
at many different sets of query points than it is to compute the interpolations separately using the functionsgriddata
orgriddatan
. For example:% Fast to create interpolant F and evaluate multiple timesF = scatteredInterpolant(X,Y,V) v1 = F(Xq1,Yq1) v2 = F(Xq2,Yq2)% Slower to compute interpolations separately using griddatav1 = griddata (X, Y, V, Xq1 Yq1) v2 = griddata (X, Y, V, Xq2,Yq2)
To change the interpolation sample values or interpolation method, it is more efficient to update the properties of the interpolant object
F
than it is to create a newscatteredInterpolant
object. When you updateValues
orMethod
, the underlying Delaunay triangulation of the input data does not change, so you can compute new results quickly.Scattered data interpolation with
scatteredInterpolant
uses a Delaunay triangulation of the data, so can be sensitive to scaling issues in the sample pointsx
,y
,z
, orP
. When this occurs, you can usenormalize
to rescale the data and improve the results. SeeNormalize Data with Differing Magnitudesfor more information.
Algorithms
scatteredInterpolant
uses a Delaunay triangulation of the scattered sample points to perform interpolation[1].
References
[1] Amidror, Isaac. “Scattered data interpolation methods for electronic imaging systems: a survey.”Journal of Electronic Imaging. Vol. 11, No. 2, April 2002, pp. 157–176.
Extended Capabilities
已经rsion History
Introduced in R2013a