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_dcm_lock.m
    path of file: ./repos/bspm/thirdparty/spm12/toolbox/dcm_meeg
    
    the code of the file until where you have to start completion: function [pC] = spm_dcm_lock(pV)
% locks experimental effects by introducing prior correlations
% FORMAT [pC] = spm_dcm_lock(pV)
%__________________________________________________________________________
%
% pV   - prior variance
% pC   - prior covariance
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
 
% Karl Friston
% $Id: spm_dcm_lock.m 4095 2010-10-22 19:37:51Z karl $

% lock experimental effects by introducing prior correlations
%==========================================================================
pC    = spm_diag(spm_vec(pV));
for i = 1:length(pV.B)
    pB      = pV;
    pB.B{i} = pB.B{i} - pB.B{i};

    
function [pC] = spm_dcm_lock(pV)
% locks experimental effects by introducing prior correlations
% FORMAT [pC] = spm_dcm_lock(pV)
%__________________________________________________________________________
%
% pV   - prior variance
% pC   - prior covariance
%__________________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
 
% Karl Friston
% $Id: spm_dcm_lock.m 4095 2010-10-22 19:37:51Z karl $

% lock experimental effects by introducing prior correlations
%==========================================================================
pC    = spm_diag(spm_vec(pV));
for i = 1:length(pV.B)
    pB      = pV;
    pB.B{i} = pB.B{i} - pB.B{i};
    pB      = spm_vec(pV)  - spm_vec(pB);
    pB      = sqrt(pB*pB') - diag(pB);
    pC      = pC + pB;
end