


GRIDDATA_NEAREST_MATRIX - interpolate a function on a grid
This function returns interpolated u_m function of x_m and y_m,
on the grid defined by x and y.
INPUT x_m,y_m,u_M, x,y where x_m,y_m and u_m are 2d matrices,
and x,y are one dimensional vectors,
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_matrix(x_m,y_m,u_m,x,y)

0001 function [u]=griddata_nearest_matrix(x_m,y_m,u_m,x,y) 0002 %GRIDDATA_NEAREST_MATRIX - interpolate a function 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 % INPUT x_m,y_m,u_M, x,y where x_m,y_m and u_m are 2d matrices, 0007 % and x,y are one dimensional vectors, 0008 % See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 0009 % and x,y are vectores. 0010 % See griddata_perso for a user defined version of griddata ( with fuzz coeff). 0011 % 0012 % Usage: 0013 % [u]=griddata_nearest_matrix(x_m,y_m,u_m,x,y) 0014 0015 u=zeros(length(x),1); 0016 count=0; 0017 for n=1:length(x), 0018 if n>length(x)/10*count, 0019 disp(n/length(x)*100); 0020 count=count+1; 0021 end 0022 0023 [posx,posy]=find_coord_matrix(x_m,y_m,x(n),y(n)); 0024 u(n)=u_m(posx,posy); 0025 end