function [RHO_id_group, time]=loadwithbet(folder, partis) counter=1; for ppp=1:length(partis) counterf=1; for fff=1:4 toload=[folder{fff}, partis{ppp,:},'.mat'] load(toload) for item =1:3 bi=(1:3~=item); if fff<3 wi=RSA_obj_rot.trialinfo.object_1_id==item; else wi=RSA_obj_rot.trialinfo.object_2_id==item; end within(item,:)=squeeze(nanmean(RSA_obj_rot.rho(wi,item,:),1)); between(item,:)=squeeze(nanmean(nanmean(RSA_obj_rot.rho(wi,bi,:),2),1)); end RHO_id_group{counterf}(:,counter)=nanmean(within,1); counterf=counterf+1; RHO_id_group{counterf}(:,counter)=nanmean(between,1); counterf=counterf+1; RHO_id_group{counterf}(:,counter)=nanmean(within,1)-nanmean(between,1) counterf=counterf+1; end counter=counter+1; end time=RSA_obj_rot.time; end