You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: MARS_NNInterpolate_kdTree.m
    path of file: ./repos/CBIG/external_packages/SD/SDv1.5.1-svn593/BasicTools
    
    the code of the file until where you have to start completion: % Contact ythomas@csail.mit.edu or msabuncu@csail.mit.edu for bugs or questions 
%
%=========================================================================
%
%  Copyright (c) 2008 Thomas Yeo and Mert Sabuncu
%  All rights reserved.
%
%Redistribution and use in source and binary forms, with or without

    
function [vals, seedVertices] = MARS_NNInterpolate_kdTree(points, mesh, data)
%function [vals, seedVertices] = MARS_linearInterpolate_kdTree(point, mesh, data)

%description: Returns interpolated value(s) of data (on mesh) at point
%IMPORTANT: point and mesh should be on a sphere with the same radius!

%MARS Project (Thomas Yeo and Mert Sabuncu), MIT, CSAIL, (c) 2006
%Author: Mert

% Check the first 100 points of the mesh and compare the radius.
p_r_mesh = sum(mesh.vertices(:, 1:min(100, size(mesh.vertices, 2))).^2, 1);
r_mesh = mean(p_r_mesh);
if(abs(sum(p_r_mesh ./ r_mesh - 1))>1e-4)
    warning('Mesh surface is not a sphere.');
end