Reputation: 5847
I have a data, which is based on 2D structured mesh of meshgrid
format. Further, I have clouds of points on a plane (2D unstructured grid), on which I would like to interpolate the information from the structured mesh.
I tried the option interp2
, which however requires the second mesh to be in meshgrid
format. This is not my case. I also note there is scatteredInterpolant
, which does scattered data interpolation. But the interpolated information does not appear accurate. Can someone suggest high accuracy interpolation schemes for this structured to unstructured grid interpolation scenario?
Upvotes: 0
Views: 574
Reputation: 1927
Use griddata
. It gets the data (x, y, v) as scattered points and interpolates on the requested points (xq, yq).
vq = griddata(x(:), y(:), v(:), xq, yq, 'natural');
Note: You should choose the interpolation method (here 'natural' for instance) according to what exactly you want.
Upvotes: 2