MATLAB: 2d interpolation querying

interpolation

I want to interpolate two-dimensional data and be able to query from one dimension over time.
With one dimensional data, say m(t), I can use pp=pchip(t,m) where t is the known data locations and m the corresponding data points. I can then define a function mq = @(t) ppval(pp,t) and query m for any value of t in the future.
Now, I would like to do the same for two-dimensional data. Say I have 2d data, m(t,x). Then I want to be able to find an interpolated m(.,x) for any t (the values of x are fixed). The interp2 funciton seems like a possibility, but can not return piecewise polynomial structures for future evaluation like pchip does for me, and pchip does not have a 2d function.

Best Answer

Try scatteredInterpolant() or griddedInterpolant().
Related Question