I have a geographically distributed data set with X-coordinate, Y-coordinate and corresponding target value of interest D. That is, my data set consists from three vectors: X, Y, D.
Now what I would like to do, is interpolate and extrapolate the target variable D over a coordinate grid of interest. The griddata
-function in Matlab seems to be able to help me in this problem, but it only does interpolation over the convex hull determined by my data set.
What I would like to do, is to also extrapolate the data D to any rectangular coordinate grid of interest like so:
I have tried using functions like interp2
and griddedInterpolant
, but these functions seem to require that I provide the known data as monotonic matrices (using e.g. meshgrid
). That is, if I have understood correctly, I must provide X,Y,D as 2D-grids. But they are not grids, they are non-monotonic vectors.
So how can I proceed?
griddata
and theninterp2
on the regular output ofgriddata
? – Ander Biguri