0001 function vb_check_variable(B, Cov, Gact, Gall)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 fprintf('--- Check variable consistency')
0023
0024 Nsession = length(B);
0025 NsessionA = length(Gact);
0026
0027 if Nsession ~= NsessionA,
0028 fprintf('\n Number of session in MEG = %d\n', Nsession)
0029 fprintf(' Number of session in LF = %d\n', NsessionA)
0030 error('Number of session is different in MEG and Leadfield')
0031 end
0032
0033 NsessionA = length(Gall);
0034
0035 if Nsession ~= NsessionA,
0036 fprintf('\n Number of session in MEG = %d\n', Nsession)
0037 fprintf(' Number of session in LF = %d\n', NsessionA)
0038 error('Number of session is different in MEG and Leadfield')
0039 end
0040
0041 for n = 1 : Nsession
0042
0043 Nsensor = size(B{n},1);
0044
0045
0046 [Nsensor1, Nsensor2] = size(Cov{n});
0047
0048 if Nsensor ~= Nsensor1 | Nsensor ~= Nsensor2
0049 fprintf('\n Number of sensor in MEG = %d\n', Nsensor)
0050 fprintf(' Number of sensor in Cov = %d, %d\n', Nsensor1, Nsensor2)
0051 error('Number of sensor is different in MEG and Leadfield')
0052 end
0053
0054
0055 [NsensorG, Ndipole] = size(Gact{n});
0056
0057 if Nsensor ~= NsensorG,
0058 fprintf('\n Number of sensor in MEG = %d\n', Nsensor)
0059 fprintf(' Number of sensor in LF = %d\n', NsensorG)
0060 error('Number of sensor is different in MEG and Leadfield')
0061 end
0062
0063
0064 [NsensorG, Ndipole] = size(Gall{n});
0065
0066 if Nsensor ~= NsensorG,
0067 fprintf('\n Number of sensor in MEG = %d\n', Nsensor)
0068 fprintf(' Number of sensor in LF = %d\n', NsensorG)
0069 error('Number of sensor is different in MEG and Leadfield')
0070 end
0071 end
0072
0073 fprintf(' is OK\n')