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_vb_logbf.m
    path of file: ./repos/spm12
    
    the code of the file until where you have to start completion: function [xCon,SPM] = spm_vb_logbf(SPM,XYZ,xCon,ic)
% Compute and write log Bayes factor image
% FORMAT [xCon,SPM] = spm_vb_logbf(SPM,XYZ,xCon,ic)
%
% SPM    - SPM data structure
% XYZ    - voxel list
% xCon   - contrast info
% ic     - contrast number
%__________________________________________________________________________
% Copyright (C) 2012-2014 Wellcome Trust Centre for Neuroimaging

% Will Penny 
% $Id: spm_vb_logbf.m 6079 2014-06-30 18:25:37Z spm $


% Get approximate posterior covariance using Taylor-series approximation
        
%-Get number of sessions
%--------------------------------------------------------------------------
nsess = length(SPM.nscan); %length(SPM.Sess);

%-Compound Contrast

    
function [xCon,SPM] = spm_vb_logbf(SPM,XYZ,xCon,ic)
% Compute and write log Bayes factor image
% FORMAT [xCon,SPM] = spm_vb_logbf(SPM,XYZ,xCon,ic)
%
% SPM    - SPM data structure
% XYZ    - voxel list
% xCon   - contrast info
% ic     - contrast number
%__________________________________________________________________________
% Copyright (C) 2012-2014 Wellcome Trust Centre for Neuroimaging

% Will Penny 
% $Id: spm_vb_logbf.m 6079 2014-06-30 18:25:37Z spm $


% Get approximate posterior covariance using Taylor-series approximation
        
%-Get number of sessions
%--------------------------------------------------------------------------
nsess = length(SPM.nscan); %length(SPM.Sess);

%-Compound Contrast
%--------------------------------------------------------------------------
c  = xCon(ic).c;
kc = size(c,2);

%-Get posterior beta's
%--------------------------------------------------------------------------
Nk = size(SPM.xX.X,2);

for k=1:Nk
    beta(k,:) = spm_get_data(SPM.VCbeta(k),XYZ);
end