Keywords: Nearest2DInterpolExample.png Illustration of en Nearest neighbor interpolation on a dataset Compare with File BilinearInterpolExample png and File BicubicInterpolationExample png they share the dataset own in en Matlab Berland Matlab code Xcoarse Ycoarse meshgrid 0 1 2 3 0 1 2 3 ; Xfine Yfine meshgrid linspace 0 3 300 linspace 0 3 300 ; DataCoarse 1 2 4 1; 6 3 5 2; 4 2 1 5; 5 4 2 3; DataNearestFine interp2 Xcoarse Ycoarse DataCoarse Xfine Yfine 'nearest' ; figure surf Xfine Yfine DataNearestFine ; shading flat; colormap jet ; view 0 90 hold on; plot3 Xcoarse Ycoarse 10 ones size Xcoarse 'k ' 'MarkerSize' 20 colorbar print -dpng -r200 Nearest2DInterpolExample png PNG file have also been cropped before uploading Format Convert to SVG Numerical analysis Color interpolations |