Gruendler2009 / scripts /Revisions_Only_Corr.m
jalauer's picture
Add files using upload-large-folder tool
b0cc889 verified
%%
% Just for revisions
%% CONFLICT CONGRUENT
BigN=size(MEGA_ERP_Corr,1);
tx=-2000:2:1998;
t1=find(tx==-500); t2=find(tx==1000);
tx2disp=-500:2:1000;
P2=200; P2range=10; % in ms
N2=275; N2range=20;
P3=450; P3range=150;
LATE=700; LATErange=250;
figure;
subplot(4,1,1); hold on
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,19,t1:t2,[2,4,6,8]),4),1)),'r','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,19,t1:t2,[1,3,5,7]),4),1)),'b','linewidth',2);
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,19,t1:t2,[2,4,6,8]),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,19,t1:t2,[2,4,6,8]),4),1))./sqrt(BigN),'r');
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,19,t1:t2,[1,3,5,7]),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,19,t1:t2,[1,3,5,7]),4),1))./sqrt(BigN),'b');
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,19,t1:t2,[2,4,6,8]),4),1)),'r','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,19,t1:t2,[1,3,5,7]),4),1)),'b','linewidth',2);
% plot(mean(mean(RT(:,[2,4,6,8]))),[10],'ro');
% plot(mean(mean(RT(:,[1,3,5,7]))),[10],'bo');
% plot([0 0],[-5 15],'k:'); plot([-500 1000],[0 0],'k:');
%plot([P2 P2],[-5 15],'m'); plot([P2-10 P2-10],[-5 15],'c'); plot([P2+10 P2+10],[-5 15],'c'); text(P2,-5,'P2');
% plot([N2 N2],[-5 15],'m'); plot([N2-20 N2-20],[-5 15],'c'); plot([N2+20 N2+20],[-5 15],'c'); text(N2,-5,'N2');
title('FCz')
legend({'CONFLICT','CONGRUENT'})
subplot(4,1,2); hold on
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,28,t1:t2,[2,4,6,8]),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,28,t1:t2,[2,4,6,8]),4),1))./sqrt(BigN),'r');
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,28,t1:t2,[1,3,5,7]),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,28,t1:t2,[1,3,5,7]),4),1))./sqrt(BigN),'b');
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,28,t1:t2,[2,4,6,8]),4),1)),'r','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,28,t1:t2,[1,3,5,7]),4),1)),'b','linewidth',2);
% plot(mean(mean(RT(:,[2,4,6,8]))),[10],'ro');
% plot(mean(mean(RT(:,[1,3,5,7]))),[10],'bo');
% plot([0 0],[-5 15],'k:'); plot([-500 1000],[0 0],'k:');
% %plot([P2 P2],[-5 15],'m'); plot([P2-10 P2-10],[-5 15],'c'); plot([P2+10 P2+10],[-5 15],'c'); text(P2,-5,'P2');
% %plot([N2 N2],[-5 15],'m'); plot([N2-20 N2-20],[-5 15],'c'); plot([N2+20 N2+20],[-5 15],'c'); text(N2,-5,'N2');
% plot([P3 P3],[-5 15],'m'); plot([P3-P3range P3-P3range],[-5 15],'c'); plot([P3+P3range P3+P3range],[-5 15],'c'); text(P3,-5,'P3');
title('Cz')
subplot(4,1,3); hold on
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,46,t1:t2,[2,4,6,8]),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,46,t1:t2,[2,4,6,8]),4),1))./sqrt(BigN),'r');
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,46,t1:t2,[1,3,5,7]),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,46,t1:t2,[1,3,5,7]),4),1))./sqrt(BigN),'b');
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,46,t1:t2,[2,4,6,8]),4),1)),'r','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,46,t1:t2,[1,3,5,7]),4),1)),'b','linewidth',2);
% plot(mean(mean(RT(:,[2,4,6,8]))),[10],'ro');
% plot(mean(mean(RT(:,[1,3,5,7]))),[10],'bo');
% plot([0 0],[-5 15],'k:'); plot([-500 1000],[0 0],'k:');
% plot([P3 P3],[-5 15],'m'); plot([P3-P3range P3-P3range],[-5 15],'c'); plot([P3+P3range P3+P3range],[-5 15],'c'); text(P3,-5,'P3');
% plot([LATE LATE],[-5 15],'m'); plot([LATE-LATErange LATE-LATErange],[-5 15],'c'); plot([LATE+LATErange LATE+LATErange],[-5 15],'c'); text(LATE,-5,'LATE');
title('Pz')
subplot(4,1,4); hold on
tx=-2000:2:1998;
LRP_t1=find(tx==-1000); LRP_t2=find(tx==500);
LRP_tx2disp=-1000:2:500;
shadedErrorBar(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,[2,4,6,8]),3),1)),squeeze(std(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,[2,4,6,8]),3),1))./sqrt(BigN),'r');
shadedErrorBar(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,[1,3,5,7]),3),1)),squeeze(std(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,[1,3,5,7]),3),1))./sqrt(BigN),'b');
plot(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,[2,4,6,8]),3),1)),'r','linewidth',2);
plot(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,[1,3,5,7]),3),1)),'b','linewidth',2);
plot([0 0],[-.1 .1],'k:'); plot([-1000 500],[0 0],'k:');
% plot([-300 -300],[-2 2],'c'); plot([-150 -150],[-2 2],'c');
% plot([-150 -150],[-2 2],'c'); plot([-50 -50],[-2 2],'c');
title('LRP')
%% REPEAT vs. SWITCH
figure;
site=19;
subplot(4,1,1); hold on
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),'k','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),'g','linewidth',2);
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1))./sqrt(BigN),'k');
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1))./sqrt(BigN),'g');
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),'k','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),'g','linewidth',2);
% plot(mean(mean(RT(:,1:4))),[10],'ko');
% plot(mean(mean(RT(:,5:8))),[10],'go');
% plot([0 0],[-5 15],'k:'); plot([-500 1000],[0 0],'k:');
% % plot([P2 P2],[-5 15],'m'); plot([P2-10 P2-10],[-5 15],'c'); plot([P2+10 P2+10],[-5 15],'c'); text(P2,-5,'P2');
% plot([N2 N2],[-5 15],'m'); plot([N2-20 N2-20],[-5 15],'c'); plot([N2+20 N2+20],[-5 15],'c'); text(N2,-5,'N2');
title('FCz')
legend({'REPEAT','SWITCH'})
subplot(4,1,2); hold on
site=28;
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1))./sqrt(BigN),'k');
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1))./sqrt(BigN),'g');
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),'k','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),'g','linewidth',2);
% plot(mean(mean(RT(:,1:4))),[10],'ko');
% plot(mean(mean(RT(:,5:8))),[10],'go');
% plot([0 0],[-5 15],'k:'); plot([-500 1000],[0 0],'k:');
% %plot([P2 P2],[-5 15],'m'); plot([P2-10 P2-10],[-5 15],'c'); plot([P2+10 P2+10],[-5 15],'c'); text(P2,-5,'P2');
% %plot([N2 N2],[-5 15],'m'); plot([N2-20 N2-20],[-5 15],'c'); plot([N2+20 N2+20],[-5 15],'c'); text(N2,-5,'N2');
% plot([P3 P3],[-5 15],'m'); plot([P3-P3range P3-P3range],[-5 15],'c'); plot([P3+P3range P3+P3range],[-5 15],'c'); text(P3,-5,'P3');
title('Cz')
subplot(4,1,3); hold on
site=46;
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1))./sqrt(BigN),'k');
shadedErrorBar(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),squeeze(std(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1))./sqrt(BigN),'g');
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,1:4),4),1)),'k','linewidth',2);
plot(tx2disp,squeeze(mean(mean(MEGA_ERP_Corr(:,site,t1:t2,5:8),4),1)),'g','linewidth',2);
% plot(mean(mean(RT(:,1:4))),[10],'ko');
% plot(mean(mean(RT(:,5:8))),[10],'go');
% plot([0 0],[-5 15],'k:'); plot([-500 1000],[0 0],'k:');
% plot([P3 P3],[-5 15],'m'); plot([P3-P3range P3-P3range],[-5 15],'c'); plot([P3+P3range P3+P3range],[-5 15],'c'); text(P3,-5,'P3');
% plot([LATE LATE],[-5 15],'m'); plot([LATE-LATErange LATE-LATErange],[-5 15],'c'); plot([LATE+LATErange LATE+LATErange],[-5 15],'c'); text(LATE,-5,'LATE');
title('Pz')
subplot(4,1,4); hold on
tx=-2000:2:1998;
LRP_t1=find(tx==-1000); LRP_t2=find(tx==500);
LRP_tx2disp=-1000:2:500;
shadedErrorBar(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,1:4),3),1)),squeeze(std(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,1:4),3),1))./sqrt(BigN),'k');
shadedErrorBar(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,5:8),3),1)),squeeze(std(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,5:8),3),1))./sqrt(BigN),'g');
plot(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,1:4),3),1)),'k','linewidth',2);
plot(LRP_tx2disp,squeeze(mean(mean(MEGA_ERP_RESP_Corr(:,LRP_t1:LRP_t2,5:8),3),1)),'g','linewidth',2);
plot([0 0],[-.1 .1],'k:'); plot([-1000 500],[0 0],'k:');
% plot([-300 -300],[-2 2],'c'); plot([-150 -150],[-2 2],'c');
% plot([-150 -150],[-2 2],'c'); plot([-50 -50],[-2 2],'c');
title('LRP')