Interpolation using interpn (or inter2, interp3, etc.) offers several options - linear, nearest, spline. However an interpolation method not offered is that based on a simplicial dissection of the n-d hypercube. Since a few people have asked me for it, here it is. The dissection of the cube used breaks each hyper-rectangle in the lattice into factorial(n) simplexes.
Why might one use this tool? The "linear" interpolation method used by interpn is actually a tensor product linear interpolant. In fact, that is not truly a linear interpolant. It has some properties that can be problematic. (Look at what that interpolant does along a diagonal of the lattice. That "linear" interpolant will often interesting behavior for something one expects to be linear.)
Interpns uses a simplicial interpolation scheme, breaking each hyper-rectangle of the lattice up into a set of factorial(n) simplexes. Within any simplex, the interpolation will always be purely linear. In addition, the interpolation along a choice diagonal of that lattice will always be truly linear. This is important for those who work in color manipulations for example, using n-d lookup tables.
Finally, the simplicial interpolant, based on barycentric coordinates within any given simplex, is assured never to create ringing behavior, as might be caused by a spline for example. And simplicial interpolation will be fairly efficient.
Cite As
John D'Errico (2026). INTERPNS (https://www.mathworks.com/matlabcentral/fileexchange/30932-interpns), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- MATLAB > Mathematics > Interpolation >
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
