


GRIDDATA_NEAREST_NAN - interpolates 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, u_m, x,y are all 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_nan(x_m,y_m,u_m,x,y)

0001 function [u]=griddata_nearest_nan(x_m,y_m,u_m,x,y) 0002 %GRIDDATA_NEAREST_NAN - interpolates 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, u_m, x,y are all one dimensional vectors, 0007 % See griddata_nearest_matrix for the case where x_m,y_m and u_m are matrices 0008 % and x,y are vectores. 0009 % See griddata_perso for a user defined version of griddata ( with fuzz coeff). 0010 % 0011 % Usage: 0012 % [u]=griddata_nearest_nan(x_m,y_m,u_m,x,y) 0013 0014 u=zeros(length(x),1); 0015 0016 pos=find(~isnan(u_m)); 0017 0018 for n=1:length(x), 0019 [posx,posy]=find_coord(x_m,y_m,x(n),y(n)); 0020 u(n)=u_m(posx,posy); 0021 end