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: mesh_spectrum.m
    path of file: ./repos/spm/external/fieldtrip/private
    
    the code of the file until where you have to start completion: % Mesh spectrum

function [L,H,d] = mesh_spectrum(S,n,varargin)

%[L,H,d] = ct_mesh_spectrum(S,n,mode)
% Compute the mesh laplace matrix 
    
function [L,H,d] = mesh_spectrum(S,n,varargin)

%[L,H,d] = ct_mesh_spectrum(S,n,mode)
% Compute the mesh laplace matrix and its spectrum
% input,
% S: mesh file, it has to have a pnt and a tri field
% n: number of mesh harmonic functions
% mode: 'full' for the full graph, 'half' if you want to do the first and
% the second half independ