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: lmoutrn.m
    path of file: ./repos/fieldtrip/utilities/private
    
    the code of the file until where you have to start completion: function [la, mu, dist, proj] = lmoutrn(v1, v2, v3, r)

% LMOUTRN computes the la/mu parameters of a point projected to triangles
%
% Use as
%   [la, mu, dist, proj] = lmoutrn(v1, v2, v3, r)
% where v1, v2 and v3 are Nx3 matrices with vertex positions of the triangles, 
% and r is the point that is projected onto the planes spanned by the vertices
% This is a vectorized version of Robert's lmoutrn function and is
% generally faster than a for-loop around the mex-file. It also returns the 
% projection of the point r onto the planes of the triangles, and the signed
% distance to the triangles. The sign of the distance is negative if the point
% lies closer to the average across all vertices and the triangle under consideration.

% Copyright (C) 2012, Jan-Mathijs Schoffelen

    
function [la, mu, dist, proj] = lmoutrn(v1, v2, v3, r)

% LMOUTRN computes the la/mu parameters of a point projected to triangles
%
% Use as
%   [la, mu, dist, proj] = lmoutrn(v1, v2, v3, r)
% where v1, v2 and v3 are Nx3 matrices with vertex positions of the triangles, 
% and r is the point that is projected onto the planes spanned by the vertices
% This is a vectorized version of Robert's lmoutrn function and is
% generally faster than a for-loop around the mex-file. It also returns the 
% projection of the point r onto the planes of the triangles, and the signed
% distance to the triangles. The sign of the distance is negative if the point
% lies closer to the average across all vertices and the triangle under consideration.

% Copyright (C) 2012, Jan-Mathijs Schoffelen
%
% 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 size(r,1)==1 && size(v1,1)>1
  r = repmat(r, [size(v1,1), 1]);
end