Have you seen the interp2 function?
From the MatLab documentation:
ZI = interp2(X,Y,Z,XI,YI) returns a ZI matrix containing the elements corresponding to the elements XI and YI , and is determined by interpolation in the two-dimensional function given by the matrices X , Y and Z , X and Y must be monotonic and have same format ("plaid"), as if they were created using meshgrid . Matrices X and Y indicate the points at which data Z is given. Out-of-range values โโare returned as NaN s.
source share