-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig6.m
137 lines (107 loc) · 4.04 KB
/
fig6.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
clear;
% opengl software
addpath('./functions/');
D_main = load('./data/preproc/context_dependent_face_categorization_task.mat').trial_data;
D_idt_col = load('./data/preproc/identity_versus_color.mat').trial_data;
D_mot_col = load('./data/preproc/motion_versus_color.mat').trial_data;
%% Fig 6D (left panels, same as Fig 2A)
D = D_main;
subj = cellfun(@(x) x.subj, D, 'uni', 0);
cond_switch = cellfun(@(x) x.cond_switch, D);
coh = cellfun(@(x) x.coh, D);
resp = cellfun(@(x) x.resp, D);
rt = cellfun(@(x) x.rt, D);
clear opt
opt.subj_list = {'002','005','007','008','012','013','010','014'};
opt.color = {'k', 'r'};
opt.legend = {'Non-switch', 'Switch'};
opt.xlabel = 'Stimulus strength (%)';
opt.ylim = [0.5, 1.7];
run_show_choiceRT(cond_switch, coh, resp, rt, subj, opt);
%% Fig 6D (middle panels)
D = D_idt_col;
subj = cellfun(@(x) x.subj, D, 'uni', 0);
cond_switch = cellfun(@(x) x.cond_switch, D);
coh = cellfun(@(x) x.coh, D);
resp = cellfun(@(x) x.resp, D);
rt = cellfun(@(x) x.rt, D);
clear opt
opt.subj_list = {'020','048','049','037','038','057','012'};
opt.color = {'k', 'r'};
opt.legend = {'Non-switch', 'Switch'};
opt.xlabel = 'Stimulus strength (%)';
opt.ylim = [0.5, 1.7];
run_show_choiceRT(cond_switch, coh, resp, rt, subj, opt);
%% Fig 6D (right panels)
D = D_mot_col;
subj = cellfun(@(x) x.subj, D, 'uni', 0);
cond_switch = cellfun(@(x) x.cond_switch, D);
coh = cellfun(@(x) x.coh, D);
resp = cellfun(@(x) x.resp, D);
rt = cellfun(@(x) x.rt, D);
cond = cellfun(@(x) x.cond, D);
coh = coh_normalization(coh, cond); % coherence normalization
clear opt
opt.subj_list = {'025','027','017','053','050','014','054'};
opt.color = {'k', 'r'};
opt.legend = {'Non-switch', 'Switch'};
opt.xlabel = 'Relative stimulus strength';
opt.xlim = [-1.1 1.1]; % relative stimulus strength
opt.ylim = [0.5, 1.7];
run_show_choiceRT_mot_col(cond_switch, coh, resp, rt, subj, opt);
%% Fig 6E (left panels)
D = D_main;
subj = cellfun(@(x) x.subj, D, 'uni', 0);
cond_switch = cellfun(@(x) x.cond_switch, D);
coh = cellfun(@(x) x.coh, D);
resp = cellfun(@(x) x.resp, D);
rt = cellfun(@(x) x.rt, D);
cond = cellfun(@(x) x.cond, D);
clear opt
opt.subj_list = {'002','005','007','008','012','013','010','014'};
opt.color = {'k', 'r'};
opt.legend = {'Non-switch', 'Switch'};
opt.xlabel = 'Stimulus strength (%)';
opt.ylim = [0.5, 1.7];
I = cond==1;
run_show_choiceRT(cond_switch(I), coh(I), resp(I), rt(I), subj(I), opt); % Identity trials
I = cond==2;
run_show_choiceRT(cond_switch(I), coh(I), resp(I), rt(I), subj(I), opt); % Expression trials
%% Fig 6E (middle panels)
D = D_idt_col;
subj = cellfun(@(x) x.subj, D, 'uni', 0);
cond_switch = cellfun(@(x) x.cond_switch, D);
coh = cellfun(@(x) x.coh, D);
resp = cellfun(@(x) x.resp, D);
rt = cellfun(@(x) x.rt, D);
cond = cellfun(@(x) x.cond, D);
clear opt
opt.subj_list = {'020','048','049','037','038','057','012'};
opt.color = {'k', 'r'};
opt.legend = {'Non-switch', 'Switch'};
opt.xlabel = 'Stimulus strength (%)';
opt.ylim = [0.5, 1.7];
I = cond==1;
run_show_choiceRT(cond_switch(I), coh(I), resp(I), rt(I), subj(I), opt); % Identity trials
I = cond==2;
run_show_choiceRT(cond_switch(I), coh(I), resp(I), rt(I), subj(I), opt); % Color trials
%% Fig 6E (right panels)
D = D_mot_col;
subj = cellfun(@(x) x.subj, D, 'uni', 0);
cond_switch = cellfun(@(x) x.cond_switch, D);
coh = cellfun(@(x) x.coh, D);
resp = cellfun(@(x) x.resp, D);
rt = cellfun(@(x) x.rt, D);
cond = cellfun(@(x) x.cond, D);
coh = coh_normalization(coh, cond); % coherence normalization
clear opt
opt.subj_list = {'025','027','017','053','050','014','054'};
opt.color = {'k', 'r'};
opt.legend = {'Non-switch', 'Switch'};
opt.xlabel = 'Relative stimulus strength';
opt.xlim = [-1.1 1.1]; % relative stimulus strength
opt.ylim = [0.5, 1.7];
I = cond==1;
run_show_choiceRT_mot_col(cond_switch(I), coh(I), resp(I), rt(I), subj(I), opt); % Motion trials
I = cond==2;
run_show_choiceRT_mot_col(cond_switch(I), coh(I), resp(I), rt(I), subj(I), opt); % Color trials