Dear Hweeling Your code looks fine. Unfortunately, this error message just says something is unexpected about the DCMs, but doesn't provide detail. Please could you check that GCM is a cell array with one row per subject? And that when you type: GCM{1} And press enter into the Matlab workspace, you either see the filename of the DCM, or you see a series of fields. If you see a series of fields, please could you check this includes ones named 'F' and 'Ep'? If you see a filename, please could you load it in and type: DCM And press enter. And then check it has fields named 'F' and 'Ep'? Best Peter -----Original Message----- From: SPM (Statistical Parametric Mapping) <[log in to unmask]> On Behalf Of Hwee Ling Lee Sent: 05 February 2019 09:20 To: [log in to unmask] Subject: [SPM] error in PEB DCM Dear all, I have encountered an error on my DCM analyses, and I hope to get some guidance to resolve the issue. I'm currently using SPM version 7487. I have 2 groups of participants, 56 in one group and 23 in another group. I have completed the creating the GCM variable using spm_dcm_bmr(GCM). I would like to compare group 1 vs. group 2 to examine connectivity differences between the 2 groups. However, when I tried to use this code: M = struct(); M.alpha = 1; M.beta = 16; M.hE = 0; M.hC = 1/16; M.Q = 'all'; M.X(:,1) = ones(79,1); M.X(:,2) = [ones(56,1)*1; ones(23,1)*-1]; M.Xnames = {'Group mean', 'Group diff'}; field = {'A'}; PEB = spm_dcm_peb(GCM, M, field); BMA = spm_dcm_peb_bmc(PEB(1)); I get an error message: Undefined function or variable "pC". Error in spm_find_pC (line 52) if isstruct(pC) Error in spm_dcm_peb (line 148) q = spm_find_pC(DCM,field); % parameter indices Thanks! Cheers, Hweeling