2d interpolation querying

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.

 Accepted Answer

Image Analyst
Image Analyst on 25 Sep 2017
Try scatteredInterpolant() or griddedInterpolant().

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!