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.
引用格式
John D'Errico (2024). INTERPNS (https://www.mathworks.com/matlabcentral/fileexchange/30932-interpns), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0.0 |