clear all; mainfolder='U:/' load('good_partis.mat') %list of participant with a good performance partis=good_partis'; partis_sub=good_partis'; %% 1st Panel figure; oris=[11.25;33.75;56.25;78.75;101.25;123.75;146.25;168.75;191.25;213.75;236.25;258.75;281.25;303.75;326.25;348.75]; colores=(colormap((hsv(16)))); colores=[colores(13:16,:);colores(1:4,:);colores(5:8,:);colores(9:12,:);] rrr=ones(1,16)*1; for ooo=1:16 polarplot(deg2rad(oris(ooo)),rrr(ooo),'wo','MarkerSize',18,'LineWidth',2,'MarkerFaceColor',colores(ooo,:));hold on, end rlim([0.5 1.1]) oris1=[0 90 180 270]' ost=[num2str(oris1)] ost(:,4)='°' thetaticks(oris1) thetaticklabels(ost) ax=gca; ax.ThetaGrid='on'; ax.RGrid='off'; ax.RTickLabel=[]; set(gca,'FontSize',20); set(gca,'color','none'); %% 2nd Panel %% Uncomment to run from scratch % %% Parameters to be modify per loop % % tobefound{1} = 'find(data_epoch_thr.trialinfo.object_1_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==1)'; % tobefound{2} = 'find(data_epoch_thr.trialinfo.object_2_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==2)'; % tobefound{3} = 'find(data_epoch_thr.trialinfo.object_2_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue==2)'; % tobefound{4} = 'find(data_epoch_thr.trialinfo.object_1_rot==objlist(k)&data_epoch_thr.trialinfo.retrocue_uncued==1)'; % % %% % foldlo{1}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/'; % foldlo{2}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/'; % foldlo{3}='eyelink_preprocessed/mean_recentered_th100/object_1_onset_11_seconds/'; % foldlo{4}='eyelink_preprocessed/mean_recentered_th100/2nd_cue_onset_17_5__seconds/'; % % %% % item_id_rsa{1}=nan(length(partis),16,3,5501); % item_id_rsa{2}=nan(length(partis),16,3,5501); % item_id_rsa{3}=nan(length(partis),16,3,5501); % item_id_rsa{4}=nan(length(partis),16,3,8751); % %% % for fff=1:4 % % for ppp=1:length(partis) % % %% Loading dataset % toload =[mainfolder foldlo{fff} partis{ppp,:} '.mat']; % load(toload) % % %Loading logfiles % % subtable=[]; % % if strcmp(partis_sub{ppp,:},'p11') % load([mainfolder 'logfiles/resultfile_p11_table_repaired.mat']) % subtable=sub % else % % sub = tdfread([mainfolder 'logfiles/resultfile_' partis_sub{ppp,:} '.txt'],'tab'); %Logfile for this participant % subtable=struct2table(sub); % end % % % % %% Selecting trials per rot only (not ID) % % objlistid=unique(data_epoch_thr.trialinfo.object_1_id); % counter=1; % % objlist=unique(data_epoch_thr.trialinfo.object_1_rot); % % for k =1:length(objlist) % % triales = eval(tobefound{fff}); % [t_s_ave{counter}] = squeeze(nanmean(data_epoch_thr.eyedat(triales,:,:),1)); % counter=counter+1; % % end % % %% Substracting the mean per condition (not in this case) % % for k = 1:length(t_s_ave); % % if ~isempty(t_s_ave{k}) % % rr=(t_s_ave{k}); % item_id_rsa{fff}(ppp,k,:,:)=[rr]; % % elseif isnan(t_s_ave{k}) % item_id_rsa{fff}(ppp,k,1:3,1:size(data_epoch_thr.eyedat,3))=NaN; % end % end % % time{fff}=data_epoch_thr.time; % % %% % % end % % end % %% % % save('circledata.mat','objlist','item_id_rsa', 'time') %% Load results load('circledata.mat') %% Plots IDs = {'1',' ',' ','4','5',' ',' ','8','9',' ',' ','12','13',' ',' ','16'} colores=(colormap(flip(hsv(16)))); toi{1} = [400 1000]; toi{2} = [1400 2000]; toi{3} = [5350 5850]; toi{4} = [2350 2850]; titu={'stimulus 1';'stimulus 2';'delay 1';'delay 2';} figure for fff=1:4 subplot(1,4,fff) ave_item_id_rsa=squeeze(nanmedian(item_id_rsa{fff},1)); std_item_id_rsa=squeeze(std(item_id_rsa{fff},1,1)); avg_std_item_id_rsa=squeeze(nanmean(std_item_id_rsa(:,1:2,:),2)); t1=find(time{1}==toi{fff}(1)); t2=find(time{1}==toi{fff}(2)); for ppp=1:size(item_id_rsa{fff},1) x=squeeze(mean(item_id_rsa{fff}(ppp,:,1,t1:t2),4)); y=squeeze(mean(item_id_rsa{fff}(ppp,:,2,t1:t2).*-1,4)); sct=scatter(x,y,60,colores,'filled','MarkerFaceAlpha',.25);hold on; end x=mean(ave_item_id_rsa(:,1,t1:t2),3); y=mean(ave_item_id_rsa(:,2,t1:t2).*-1,3); z=(mean(avg_std_item_id_rsa(:,t1:t2),2)/40)*250; sct=scatter(x,y,z,colores,'filled','MarkerEdgeColor',[1 1 1],... 'LineWidth',1.5) set(gca,'Color','k') ao=0.8/0.0217; xlim([-ao ao]) ylim([-ao ao]) pixtovd=0.0217; %pixel to visual degrees set(gca,'XTick',-ao:(ao/2):ao) set(gca,'XTickLabel',(-ao:(ao/2):ao)*pixtovd) set(gca,'YTick',-ao:(ao/2):ao) set(gca,'YTickLabel',(-ao:(ao/2):ao)*pixtovd) title(titu{fff}) % ylabel('° vis. angle') xlabel('° vis. angle') set(gca,'FontSize',20); end