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_BMS_gibbs.m
    path of file: ./repos/ExploreASL/External/SPMmodified
    
    the code of the file until where you have to start completion: function [exp_r,xp,r_samp,g_post] = spm_BMS_gibbs (lme, alpha0, Nsamp)
% Bayesian model selection for group studies using Gibbs sampling
% FORMAT [exp_r,xp,r_samp,g_post] = spm_BMS_gibbs (lme, alpha0, Nsamp)
%
% INPUT:
% lme      - array of log model evidences 
%              rows: subjects
%              columns: models (1..Nk)
% alpha0   - [1 x Nk] vector of prior model counts
% Nsamp    - number of samples (default: 1e6)
% 
% OUTPUT:
% exp_r    - [1 x  Nk] expectation of the posterior p(r|y)
% xp       - exceedance probabilities
% r_samp   - [Nsamp x Nk] matrix of samples from posterior
% g_post   - [Ni x Nk] matrix of posterior probabilities with 
%            g_post(i,k) being post prob that subj i used model k
%__________________________________________________________________________

    
function [exp_r,xp,r_samp,g_post] = spm_BMS_gibbs (lme, alpha0, Nsamp)
% Bayesian model selection for group studies using Gibbs sampling
% FORMAT [exp_r,xp,r_samp,g_post] = spm_BMS_gibbs (lme, alpha0, Nsamp)
%
% INPUT:
% lme      - array of log model evidences 
%              rows: subjects
%              columns: models (1..Nk)
% alpha0   - [1 x Nk] vector of prior model counts
% Nsamp    - number of samples (default: 1e6)
% 
% OUTPUT:
% exp_r    - [1 x  Nk] expectation of the posterior p(r|y)
% xp       - exceedance probabilities
% r_samp   - [Nsamp x Nk] matrix of samples from posterior
% g_post   - [Ni x Nk] matrix of posterior probabilities with 
%            g_post(i,k) being post prob that subj i used model k
%__________________________________________________________________________
% Copyright (C) 2009-2013 Wellcome Trust Centre for Neuroimaging

% Will Penny
% $Id: spm_BMS_gibbs.m 6381 2015-03-17 17:55:09Z will $


if nargin < 3 || isempty(Nsamp)
    Nsamp = 1e4;
end