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: interp_ungridded.m
    path of file: ./repos/fieldtrip/private
    
    the code of the file until where you have to start completion: function varargout = interp_ungridded(pos_from, pos_to, varargin)

% INTERP_UNGRIDDED computes an interpolation matrix for two clouds of 3-D points
%
% To get the interpolated data, use as
%   [valto] = interp_ungridded(pos_from, pos_to, 'data', valfrom, ...)
% or to get the interpolation matrix itself, use as
%   [interpmat, distmat] = interp_ungridded(pos_from, pos_to, ...)
% where
%   pos_from  Nx3 matrix with the vertex positions
%   pos_to    Mx3 matrix with the vertex positions onto which the data should be interpolated
%
% Optional arguments are specified in key-value pairs and can be
%    data         = NxK matrix with functional data
%    distmat      = NxM matrix with precomputed distances
%    projmethod   = 'nearest', 'sphere_avg', 'sphere_weighteddistance', 'smudge'
%    triout       = triangulation for the second set of vertices
%    sphereradius = scalar
%    power        = scalar, power parameter as in the Inverse Distance Weighting function proposed by Shepard (default = 1).

% Copyright (C) 2007-2018, Jan-Mathijs Schoffelen & Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%

    
function varargout = interp_ungridded(pos_from, pos_to, varargin)

% INTERP_UNGRIDDED computes an interpolation matrix for two clouds of 3-D points
%
% To get the interpolated data, use as
%   [valto] = interp_ungridded(pos_from, pos_to, 'data', valfrom, ...)
% or to get the interpolation matrix itself, use as
%   [interpmat, distmat] = interp_ungridded(pos_from, pos_to, ...)
% where
%   pos_from  Nx3 matrix with the vertex positions
%   pos_to    Mx3 matrix with the vertex positions onto which the data should be interpolated
%
% Optional arguments are specified in key-value pairs and can be
%    data         = NxK matrix with functional data
%    distmat      = NxM matrix with precomputed distances
%    projmethod   = 'nearest', 'sphere_avg', 'sphere_weighteddistance', 'smudge'
%    triout       = triangulation for the second set of vertices
%    sphereradius = scalar
%    power        = scalar, power parameter as in the Inverse Distance Weighting function proposed by Shepard (default = 1).

% Copyright (C) 2007-2018, Jan-Mathijs Schoffelen & Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.fieldtriptoolbox.org
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
%
% $Id$

if nargin<3
  ft_error('Not enough input arguments.');
end