Mathematics    

Comparing Interpolation Methods

This example compares two-dimensional interpolation methods on a 7-by-7 matrix of data.

  1. Generate the peaks function at low resolution.
  2. Generate a finer mesh for interpolation.
  3. Interpolate using nearest neighbor interpolation.
  4. Interpolate using bilinear interpolation:
  5. Interpolate using bicubic interpolation.
  6. Compare the surface plots for the different interpolation methods.

  7. Compare the contour plots for the different interpolation methods.

Notice that the bicubic method, in particular, produces smoother contours. This is not always the primary concern, however. For some applications, such as medical image processing, a method like nearest neighbor may be preferred because it doesn't generate any "new" data values.


  Two-Dimensional Interpolation Interpolation and Multidimensional Arrays