How do I write interpolation in Matlab?
vq = interp1( x , v , xq ) returns interpolated values of a 1-D function at specific query points using linear interpolation. Vector x contains the sample points, and v contains the corresponding values, v(x). Vector xq contains the coordinates of the query points.
How do you interpolate a surface in Matlab?
vq = griddata( x , y , v , xq , yq ) fits a surface of the form v = f(x,y) to the scattered data in the vectors (x,y,v) . The griddata function interpolates the surface at the query points specified by (xq,yq) and returns the interpolated values, vq .