function zi = gridgen_griddata ( x, y, z, xi, yi )

n = length(xi(:));
zi = zeros(size(xi));
for i = 1:n
    bathy_ind = gridgen_nearest_pts ( x, y, xi(i), yi(i) );
    zi(i) = z(bathy_ind);
end



return;

