Thanks. Also, below is a short routine I use in SPM8, that you had helped me with in the past, to make sure each subjects data has all the conditions (even if there are no trials in it). % after epoching cnew = {S.trialdef.conditionlabel}; % after averaging corig = D.condlist; c = zeros(numel(cnew), numel(corig)); [sel1, sel2] = spm_match_str(cnew, corig); for i = 1:length(sel1) c(sel1(i), sel2(i)) = 1; end nrepl = zeros(1, numel(cnew)); nrepl(sel1) = D.repl; S = []; S.D = D; S.c = c; S.label = cnew; S.WeightAve = 0; D = spm_eeg_weight_epochs(S); S = []; S.D = D; for m = 1:D.ntrials rpl = D.repl(m); if rpl>100 D = repl(D,m,0); end end save (D); However, it seems that in SPM12 "spm_eeg_weight_epochs" doesn't exist. I tried using the "spm_eeg_contrast" instead but it doesn't create the missing conditions and changes are the number of repl in the conditions that are already present. Any help would be much appreciated. Thanks -Muhammad On Wed, Jun 24, 2015 at 12:53 PM, Vladimir Litvak <[log in to unmask] > wrote: > See https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;10699a6c.1310 > > On Wed, Jun 24, 2015 at 5:43 PM, Muhammad Adeel Parvaz <[log in to unmask]> > wrote: > >> Hi, >> >> I have been using 'reject' function in SPM8 to get rid of some of the >> trials from the data. Apparently SPM12 doesn't have the 'reject' function. >> Is there a homologous function that I can use instead of 'reject'? >> >> Thanks >> -Muhammad >> > >