scatteredInterpn
Performs linear interpolation of a n-dimensional scattered data described
by the points X and values V. The interpolation is based on a n-dimensional
delaunayn triangulation. A barycentric interpolation scheme is employed for
all query points using tsearchn.
For slightly faster interpolation, choose nearest neighbour interpolation.
The nearst interpolation uses dsearchn instead of tsearchn.
Obs, 1-dimensional data is not supported, use interp1 instead.
Matlabs scatteredInterpolant class similarly allows for linear and nearest
neighbour scattered data interpolation. It is also significantly faster than
this function and have support for extrapolation. However, it can only handle
2D and 3D scatter data, whereas this function can handle any number of
dimensions.
Syntax:
VI = scatteredInterpn(X, V, XI)
VI = scatteredInterpn(X, V, XI, T)
[VI, T] = scatteredInterpn(X, V, XI)
VI = scatteredInterpn(___, method)
VI = scatteredInterpn(___, method, extrapval)
Input:
X - coordinates of points - [nPoints, nDim]
V - value(s) at points - [nPoints, nData]
XI - interpolation query points - [nInterpPoints, nDim]
Optional:
T - delaunayn triangulation - T = delaunayn(X);
Note, can be computed once and re-used for another data set V or for an
additional set of interpolation points XI in subsequent function calls.
method - 'linear','l' (default) OR 'nearest','n' - interpolation method
extrapval - extrapolation value, NaN (default)
Output:
VI - interpolated values - [nInterpPoints, nData]
T - delaunayn triangulation - T = delaunayn(X);
Comments:
Computationally, the main bottleneck in this function is the call to tsearchn
or dsearchn. Specifically because the underlying matlab mex-function tsrchnmx
needs transposed coordinate data.
See also: delaunayn, tsearchn, dsearchn, scatteredInterpolant, interpn
Cite As
Johan Winges (2025). scatteredInterpn (https://github.com/johwing/matlab_scatteredInterpn), GitHub. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Versions that use the GitHub default branch cannot be downloaded
Version | Published | Release Notes | |
---|---|---|---|
1.1.0.0 | Fixed submission name |
|
|
1.0.0.0 |
|