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: spm_mesh_neighbours.m
    path of file: ./repos/spm12
    
    the code of the file until where you have to start completion: function [N,D] = spm_mesh_neighbours(M,order)
% Return first-order neighbours of all vertices of a surface mesh
% FORMAT N = spm_mesh_neighbours(M,order)
% M        - a patch structure or an adjacency matrix
% order    - ordinal or euclidean distance for 1st order neighbours {[0],1}
%
% N        - a [nxp] neighbours array (n = #vertices, p = # max neighbours)
% D        - a [nxp] distance array to neighbours

    
function [N,D] = spm_mesh_neighbours(M,order)
% Return first-order neighbours of all vertices of a surface mesh
% FORMAT N = spm_mesh_neighbours(M,order)
% M        - a patch structure or an adjacency matrix
% order    - ordinal or euclidean distance for 1st order neighbours {[0],1}
%
% N        - a [nxp] neighbours array (n = #vertices, p = # max neighbours)
% D        - a [nxp] distance array to neighbours
% N & D contain 0 when number of neighbours is smaller than p.
%__________________________________________________________________________
% Copyright (C) 2010 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: spm_mesh_neighbours.m 4081 2010-10-07 14:04:44Z guillaume $

if nargin < 2, order = 0; end