


GRIDDATA_NEAREST - returns interpolated u_m function of x_m and y_m on a grid
This function returns interpolated u_m function of x_m and y_m,
on the grid defined by x and y.
See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices
and x,y are vectores.
See griddata_perso for a user defined version of griddata ( with fuzz coeff).
Usage:
[u]=griddata_nearest(x_m,y_m,u_m,x,y)

0001 function [u]=griddata_nearest(x_m,y_m,u_m,x,y) 0002 %GRIDDATA_NEAREST - returns interpolated u_m function of x_m and y_m on a grid 0003 % 0004 % This function returns interpolated u_m function of x_m and y_m, 0005 % on the grid defined by x and y. 0006 % See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 0007 % and x,y are vectores. 0008 % See griddata_perso for a user defined version of griddata ( with fuzz coeff). 0009 % 0010 % Usage: 0011 % [u]=griddata_nearest(x_m,y_m,u_m,x,y) 0012 0013 u=zeros(length(x),1); 0014 count=0; 0015 for n=1:length(x), 0016 0017 if n>length(x)/10*count, 0018 disp(n/length(x)*100); 0019 count=count+1; 0020 end 0021 0022 [posx,posy]=find_coord(x_m,y_m,x(n),y(n)); 0023 u(n)=u_m(posx,posy); 0024 end