scatteredInterpn

Linear interpolation of n-dimensional scattered data
512 Downloads
Updated 14 Jan 2016

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 (2024). scatteredInterpn (https://github.com/johwing/matlab_scatteredInterpn), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Delaunay Triangulation in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

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

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.