1

I am looking for a function in Matlab that constructs a cubic interpolation function, Z = f(X, Y), for irregularly spaced data. Basically, Matlab's griddedInterpolant function is what I'm looking for in terms of interpolation Method, whereas I'm looking for Matlab's scatteredInterpolant in terms of the regularity requirements of the input data. Namely, scatteredInterpolant only offers nearest, linear, and natural interpolation Methods.

I require cubic interpolation, because I use this function in a program that requires twice continuously differentiable functions. So, makima or pchip as interpolation methods would suffice, too, though I prefer cubic.

I did find this function on Matlab FEX, but with its poor documentation I'm not exactly sure if this is what I'm looking for. Moreover, it says it's more computationally expensive than griddedInterpolant and scatteredInterpolant, which doesn't really fit my needs.

Moreover, cubic interpolation to map the data onto a regularly spaced 3D grid and subsequently calling griddedInterpolant isn't a possibility for me.

Sam
  • 305
  • 1
  • 8
  • 2
    `scatteredInterpolant` does not do cubic, because its very expensive computationally. If that does not fit your needs you find yourself on a bad spot, as it is not possible to do something more complex and for it to be faster. Any implementation would take long. – Ander Biguri Apr 12 '20 at 16:14
  • I can’t even imagine what cubic interpolation would look like on irregularly sampled data. But you can look into methods such as [thin plate splines](https://en.m.wikipedia.org/wiki/Thin_plate_spline), which lead to a smooth function. [Shepard’s method](https://en.m.wikipedia.org/wiki/Inverse_distance_weighting) might also be applicable. – Cris Luengo Apr 12 '20 at 16:44

0 Answers0