MATLAB: What’s the difference between interp3 and scatteredinterpolant

interpolation

They can both return values of a 3-variable function u(x,y,z), at query points xq,yq,zq, based on input sample point vectors, x, y, z.
Which should one use, and why?
(I know scatteredInterpolant is meant for 'scattered' data, but what kind of data may by defined as 'scattered'?)

Best Answer

The figures in the MATLAB documentation should help you to understand the difference:
In essence:
  • gridded data consist of data points at every node of an axis-aligned ND-grid. The functions ndgrid and meshgrid are often used to generate the (axis) indices for all of these points: you should look at their outputs.
  • scattered data consist of other data arrangements. Keep in mind that gridded data must include all data points on the grid: as soon as just one node is missing it becomes scattered data.
The choice is easy: do you have a data value for every node on some (N-D) grid?
yes -> gridded data
no -> scattered data.
Related Question