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: vectorNorm.m
    path of file: ./repos/matGeom/matGeom/geom2d
    
    the code of the file until where you have to start completion: function n = vectorNorm(v, varargin)
%VECTORNORM Compute norm of a vector, or of a set of vectors.
%
%   N = vectorNorm(V);
%   Returns the euclidean norm of vector V.
%
%   N = vectorNorm(V, N);
%   Specifies the norm to use. N can be any value greater than 0. 
%   N=1 -> city lock norm
%   N=2 -> euclidean norm
%   N=inf -> compute max coord.
%
%   When V is a MxN array, compute norm for each vector of the array.
%   Vector are given as rows. Result is then a [M*1] array.
%
%   Example
%   n1 = vectorNorm([3 4])
%   n1 =
%       5
%
%   n2 = vectorNorm([1, 10], inf)
%   n2 =
%       10
%
%   See also 
%     vectors2d, vectorAngle
%

% ------
% Author: David Legland 
% E-mail: david.legland@inrae.fr

    
function n = vectorNorm(v, varargin)
%VECTORNORM Compute norm of a vector, or of a set of vectors.
%
%   N = vectorNorm(V);
%   Returns the euclidean norm of vector V.
%
%   N = vectorNorm(V, N);
%   Specifies the norm to use. N can be any value greater than 0. 
%   N=1 -> city lock norm
%   N=2 -> euclidean norm
%   N=inf -> compute max coord.
%
%   When V is a MxN array, compute norm for each vector of the array.
%   Vector are given as rows. Result is then a [M*1] array.
%
%   Example
%   n1 = vectorNorm([3 4])
%   n1 =
%       5
%
%   n2 = vectorNorm([1, 10], inf)
%   n2 =
%       10
%
%   See also 
%     vectors2d, vectorAngle
%

% ------
% Author: David Legland 
% E-mail: david.legland@inrae.fr
% Created: 2005-02-21
% Copyright 2005-2023 INRA - TPV URPOI - BIA IMASTE

% extract the type of norm to compute
d = 2;
if ~isempty(varargin)
    d = varargin{1};
end