-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOrientation_Distance.m
506 lines (418 loc) · 19.4 KB
/
Orientation_Distance.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
%% Include colour differentiation of soa
% This script is designed to characterize incorrect gabors
% 1) compare the position of the correct versus incorrect on inaccurate trials
% gabor on a) direction b) control vs experimental trials, and b) different
% SOA buckets
%2) compare orientation of incorrect and gabors with correct and
%surrounding gabors, as well as contrasting to correct gabor neighbours
%%
ccc
lengthy = 240;
Gabor_List = 1:8;
sub_nums = {'000', '001', '002', '003', '004', '005', '006', '007',...
'008', '009', '010', '011', '012'};
nsubs = length(sub_nums);
ColorMap = containers.Map({-7,-5,-3,-1,0,1,3,5,7},{[230/255 25/255 75/255],[245/255 130/255 48/255],[255/255 225/255 25/255],[210/255 245/255 60/255],[0 0 0],[70/255 240/255 240/255],[0 130/255 200/255],[145/255 30/255 180/255],[240/255 50/255 230/255]});
% ColorMap = [[230 25 75],[245 130 48],[255 225 25],[210 245 60],[0 0 0],[70 240 240],[0 130 200],[145 30 180],[240 50 230]];
%% Looking at the incorrect gabor distances as a function of direction
figure('Position',[25,25,1000,1000]);
widthHeight = ceil(sqrt(nsubs));
for i_subs = 1:nsubs
count1 = 0; count2 = 0;
current_sub = sub_nums{i_subs};
par_str1(i_subs).Incor_L = zeros(5,lengthy);
par_str1(i_subs).Incor_R = zeros(5,lengthy);
%Find output filename
Filename = dir(['.\Data\' current_sub '*']);
load(['.\Data\' Filename.name]);
for i = 1:length(par_str1(i_subs).Incor_L)
if isnan(out_incorrect_gabor(i)) ~= true
if out_direction(i) == 0
count1 = count1 + 1;
par_str1(i_subs).Incor_L(1,count1) = i; par_str1(i_subs).Incor_L(2,count1) = out_incorrect_gabor(i);
par_str1(i_subs).Incor_L(3,count1) = trialList(i,1);
normDeg = mod(par_str1(i_subs).Incor_L(2,count1) - par_str1(i_subs).Incor_L(3,count1),8);
par_str1(i_subs).Incor_L(4,count1) = min(8-normDeg, normDeg);
par_str1(i_subs).Incor_L(5,count1) = out_RT(i);
elseif out_direction(i) == 1
count2 = count2 + 1;
par_str1(i_subs).Incor_R(1,count2) = i; par_str1(i_subs).Incor_R(2,count2) = out_incorrect_gabor(i);
par_str1(i_subs).Incor_R(3,count2) = trialList(i,1);
normDeg = mod(par_str1(i_subs).Incor_R(2,count2) - par_str1(i_subs).Incor_R(3,count2),8);
par_str1(i_subs).Incor_R(4,count2) = min(8-normDeg, normDeg);
par_str1(i_subs).Incor_R(5,count2) = out_RT(i);
end
end
end
par_str1(i_subs).Incor_L_Count = count1;
par_str1(i_subs).Incor_L_Sum = sum(par_str1(i_subs).Incor_L(4,:));
par_str1(i_subs).Incor_L_Weighted = par_str1(i_subs).Incor_L_Sum/count1;
par_str1(i_subs).Incor_L_std = std(par_str1(i_subs).Incor_L(4,:));
par_str1(i_subs).Incor_R_Count = count2;
par_str1(i_subs).Incor_R_Sum = sum(par_str1(i_subs).Incor_R(4,:));
par_str1(i_subs).Incor_R_Weighted = par_str1(i_subs).Incor_R_Sum/count2;
par_str1(i_subs).Incor_R_std = std(par_str1(i_subs).Incor_R(4,:));
subplot(widthHeight,widthHeight,i_subs);
scatter(par_str1(i_subs).Incor_L(4,:),par_str1(i_subs).Incor_L(5,:),'b')
hold on
scatter(par_str1(i_subs).Incor_R(4,:),par_str1(i_subs).Incor_R(5,:),'r')
hold off
legend({'Left','Right'});
xlim([0 max(Gabor_List/2+1)]);
set(gca,'XTick',min(Gabor_List):1:max(Gabor_List))
xlabel('Incorrect Gabor Distance')
ylabel('Reaction Time (ms)')
ylim([.01 5])
title(current_sub)
end
Dir_Diff_Mean = zeros(1,nsubs);
for i = 1:nsubs
Dir_Diff_Mean(i) = par_str1(i).Incor_L_Weighted - par_str1(i).Incor_R_Weighted;
end
Dir_Diff_GA = mean(Dir_Diff_Mean);
Dir_Diff_SE = std(Dir_Diff_Mean);
% par_str1 - output structured as follows
% Incor_Left & Incor_Right
%1|index
%2|incorrect gabor position
%3|correct gabor position
%4|difference in position between gabors
%5|Reaction Time
% Plots
% Reaction time versus difference in position between correct and incorrect
% in Control trials
% fig = figure;
% scatter(Incor_L(4,:),Incor_L(5,:))
% title('RT and Difference of Incorrect and Correct Gabor Position - Left Trials');
% xlabel('Position Difference (degrees)');
% ylabel('Reaction Time (ms)');
%% Looking at the incorrect trial gabor distances as a function of condition
figure('Position',[25,25,1000,1000]);
widthHeight = ceil(sqrt(nsubs));
for i_subs = 1:nsubs
count1 = 0; count2 = 0;
current_sub = sub_nums{i_subs};
par_str2(i_subs).Incor_Con = zeros(5,lengthy);
par_str2(i_subs).Incor_Exp = zeros(5,lengthy);
%Find output filename
Filename = dir(['.\Data\' current_sub '*']);
load(['.\Data\' Filename.name]);
for i = 1:lengthy
if isnan(out_incorrect_gabor(i)) ~= true
if trialList(i,3) == 0
count1 = count1 + 1;
par_str2(i_subs).Incor_Con(1,count1) = i; par_str2(i_subs).Incor_Con(2,count1) = out_incorrect_gabor(i);
par_str2(i_subs).Incor_Con(3,count1) = trialList(i,1);
normDeg = mod(par_str2(i_subs).Incor_Con(2,count1) - par_str2(i_subs).Incor_Con(3,count1),8);
par_str2(i_subs).Incor_Con(4,count1) = min(8-normDeg, normDeg);
par_str2(i_subs).Incor_Con(5,count1) = out_RT(i);
else
count2 = count2 + 1;
par_str2(i_subs).Incor_Exp(1,count2) = i; par_str2(i_subs).Incor_Exp(2,count2) = out_incorrect_gabor(i);
par_str2(i_subs).Incor_Exp(3,count2) = trialList(i,1);
normDeg = mod(par_str2(i_subs).Incor_Exp(2,count2) - par_str2(i_subs).Incor_Exp(3,count2),8);
par_str2(i_subs).Incor_Exp(4,count2) = min(8-normDeg, normDeg);
par_str2(i_subs).Incor_Exp(5,count2) = out_RT(i);
end
end
end
par_str2(i_subs).Incor_Con_Count = count1;
par_str2(i_subs).Incor_Con_Sum = sum(par_str2(i_subs).Incor_Con(4,:));
par_str2(i_subs).Incor_Con_Weighted = par_str2(i_subs).Incor_Con_Sum/count1;
par_str2(i_subs).Incor_Con_std = std(par_str2(i_subs).Incor_Con(4,:));
par_str2(i_subs).Incor_Con_Count = count2;
par_str2(i_subs).Incor_Exp_Sum = sum(par_str2(i_subs).Incor_Exp(4,:));
par_str2(i_subs).Incor_Exp_Weighted = par_str2(i_subs).Incor_Exp_Sum/count2;
par_str2(i_subs).Incor_Exp_std = std(par_str2(i_subs).Incor_Con(4,:));
subplot(widthHeight,widthHeight,i_subs);
scatter(par_str2(i_subs).Incor_Con(4,:),par_str2(i_subs).Incor_Con(5,:),'b')
hold on
scatter(par_str2(i_subs).Incor_Exp(4,:),par_str2(i_subs).Incor_Exp(5,:),'r')
hold off
legend({'Control','Exprimental'});
xlim([0 max(Gabor_List/2+1)]);
set(gca,'XTick',min(Gabor_List):1:max(Gabor_List))
xlabel('Incorrect Gabor Distance')
ylabel('Reaction Time')
ylim([.01 5])
title(current_sub)
end
% Now we are going to representing the means of gabor difference across
% Control and Experimental
Cond_Diff_Mean = zeros(1,nsubs);
for i = 1:nsubs
Cond_Diff_Mean(i) = par_str2(i).Incor_Con_Weighted - par_str2(i).Incor_Exp_Weighted;
end
Cond_Diff_GA = mean(Cond_Diff_Mean);
Cond_Diff_SE = std(Cond_Diff_Mean);
% output structured as follows
% Incor_Con & Incor_Exp
%1|index
%2|incorrect gabor position
%3|correct gabor position
%4|difference in position between gabors
%5|Reaction Time
% Plots
% Reaction time versus difference in position between correct and incorrect
% in Control trials
% fig = figure;
% scatter(Incor_Con(4,:),Incor_Con(5,:))
% title('RT and Difference of Incorrect and Correct Gabor Position - Control Trials');
% xlabel('Position Difference (degrees)');
% ylabel('Reaction Time (ms)');
%% Looking at the incorrect trial gabor orientation as a function of surrounding gabor orientation
figure('Position',[25,25,1000,1000]);
widthHeight = ceil(sqrt(nsubs));
for i_subs = 1:nsubs
count = 0;
current_sub = sub_nums{i_subs};
par_str3(i_subs).Orient_F = zeros(8,lengthy);
%Find output filename
Filename = dir(['.\Data\' current_sub '*']);
load(['.\Data\' Filename.name]);
for i = 1:lengthy
if isnan(out_incorrect_gabor(i)) ~= true
count = count + 1;
par_str3(i_subs).Orient_F(1,count) = i; par_str3(i_subs).Orient_F(2,count) = out_incorrect_gabor(i); % pull out index and value of incorrect gabor
if par_str3(i_subs).Orient_F(2,count) == 1
lower = 8;
else
lower = par_str3(i_subs).Orient_F(2,count)-1;
end
if par_str3(i_subs).Orient_F(2,count) == 8
upper = 1;
else
upper = par_str3(i_subs).Orient_F(2,count)+1;
end
par_str3(i_subs).Orient_F(5,count) = out_rotation{i}(par_str3(i_subs).Orient_F(2,count)); % incorrect gabor
par_str3(i_subs).Orient_F(3,count) = out_rotation{i}(lower); % counterclockwise 1 position of incorrect gabor
normDeg = mod(par_str3(i_subs).Orient_F(3,count) - par_str3(i_subs).Orient_F(5,count),360);
par_str3(i_subs).Orient_F(4,count) = min(360-normDeg, normDeg);
par_str3(i_subs).Orient_F(7,count) = out_rotation{i}(upper); % clockwise 1 position of inccorect gabor
normDeg = mod(par_str3(i_subs).Orient_F(7,count) - par_str3(i_subs).Orient_F(5,count),360);
par_str3(i_subs).Orient_F(6,count) = min(360-normDeg, normDeg);
par_str3(i_subs).Orient_F(8,count) = out_RT(i);
end
end
par_str3(i_subs).Orient_Count = count;
par_str3(i_subs).Orient_F_L_Sum = sum(par_str3(i_subs).Orient_F(4,:));
par_str3(i_subs).Orient_F_L_Weighted = par_str3(i_subs).Orient_F_L_Sum/count;
par_str3(i_subs).Orient_F_L_std = std(par_str3(i_subs).Orient_F(4,:));
par_str3(i_subs).Orient_F_R_Sum = sum(par_str3(i_subs).Orient_F(6,:));
par_str3(i_subs).Orient_F_R_Weighted = par_str3(i_subs).Orient_F_R_Sum/count;
par_str3(i_subs).Orient_F_R_std = std(par_str3(i_subs).Orient_F(6,:));
subplot(widthHeight,widthHeight,i_subs);
scatter(par_str3(i_subs).Orient_F(4,:),par_str3(i_subs).Orient_F(8,:),'b')
hold on
scatter(par_str3(i_subs).Orient_F(6,:),par_str3(i_subs).Orient_F(8,:),'r')
hold off
legend({'Counterclockwise','Clockwise'});
xlim([0 180]);
set(gca,'XTick',0:20:180)
xlabel('Incorrect Gabor Orientation Difference')
ylabel('Reaction Time')
title(current_sub)
end
Ori_F_Diff_Mean = zeros(1,nsubs);
for i = 1:nsubs
Ori_F_Diff_Mean(i) = par_str3(i).Orient_F_L_Weighted - par_str3(i).Orient_F_R_Weighted;
end
Ori_F_Diff_GA = mean(Ori_F_Diff_Mean);
Ori_F_Diff_SE = std(Ori_F_Diff_Mean);
% Plots
% Reaction time versus difference in degree of left gabor orientation
% fig = figure;
% scatter(Orient_F(4,:),Orient_F(8,:))
% title('RT and Difference of Incorrect and Clockwise Flanking Gabor');
% xlabel('Angle Difference (degrees)');
% ylabel('Reaction Time (ms)');
% output structured as follows
% 1|index of trial
% 2|incorrect gabor position
% 3|counterclockwise gabor orientation
% 4|difference between counterclockwise and incorrect gabor
% 5|incorrect orientation
% 6|difference between clockwise and incorrect gabor
% 7|clockwise gabor orientation
% 8|Reaction Time
%% Looking at correct trial gabor orientation as a function of surrounding gabor orientation
figure('Position',[25,25,1000,1000]);
widthHeight = ceil(sqrt(nsubs));
for i_subs = 1:nsubs
count = 0;
current_sub = sub_nums{i_subs};
par_str4(i_subs).Orient_T = zeros(8,lengthy);
%Find output filename
Filename = dir(['.\Data\' current_sub '*']);
load(['.\Data\' Filename.name]);
for i = 1:lengthy
if isnan(out_incorrect_gabor(i)) ~= true
count = count + 1;
par_str4(i_subs).Orient_T(1,count) = i; par_str4(i_subs).Orient_T(2,count) = out_incorrect_gabor(i); % pull out index and value of incorrect gabor
if par_str4(i_subs).Orient_T(2,count) == 1
lower = 8;
else
lower = par_str4(i_subs).Orient_T(2,count)-1;
end
if par_str4(i_subs).Orient_T(2,count) == 8
upper = 1;
else
upper = par_str4(i_subs).Orient_T(2,count)+1;
end
par_str4(i_subs).Orient_T(5,count) = out_rotation{i}(par_str4(i_subs).Orient_T(2,count)); % incorrect gabor
par_str4(i_subs).Orient_T(3,count) = out_rotation{i}(lower); % counterclockwise 1 position of incorrect gabor
normDeg = mod(par_str4(i_subs).Orient_T(3,count) - par_str4(i_subs).Orient_T(5,count),360);
par_str4(i_subs).Orient_T(4,count) = min(360-normDeg, normDeg);
par_str4(i_subs).Orient_T(7,count) = out_rotation{i}(upper); % clockwise 1 position of inccorect gabor
normDeg = mod(par_str4(i_subs).Orient_T(7,count) - par_str4(i_subs).Orient_T(5,count),360);
par_str4(i_subs).Orient_T(6,count) = min(360-normDeg, normDeg);
par_str4(i_subs).Orient_T(8,count) = out_RT(i);
end
end
par_str4(i_subs).Orient_Count = count;
par_str4(i_subs).Orient_T_L_Sum = sum(par_str4(i_subs).Orient_T(4,:));
par_str4(i_subs).Orient_T_L_Weighted = par_str4(i_subs).Orient_T_L_Sum/count;
par_str4(i_subs).Orient_T_L_std = std(par_str4(i_subs).Orient_T(4,:));
par_str4(i_subs).Orient_T_R_Sum = sum(par_str4(i_subs).Orient_T(6,:));
par_str4(i_subs).Orient_T_R_Weighted = par_str4(i_subs).Orient_T_R_Sum/count;
par_str4(i_subs).Orient_T_R_std = std(par_str4(i_subs).Orient_T(6,:));
% switch -
subplot(widthHeight,widthHeight,i_subs);
scatter(par_str4(i_subs).Orient_T(4,:),par_str4(i_subs).Orient_T(8,:),25,'b','filled')
hold on
scatter(par_str4(i_subs).Orient_T(6,:),par_str4(i_subs).Orient_T(8,:),25,'r','filled')
hold off
legend({'Counterclockwise','Clockwise'});
xlim([0 180]);
set(gca,'XTick',0:20:180)
xlabel('Incorrect Gabor Orientation Difference')
ylabel('Reaction Time')
title(current_sub)
end
Ori_T_Diff_Mean = zeros(1,nsubs);
for i = 1:nsubs
Ori_T_Diff_Mean(i) = par_str4(i).Orient_T_L_Weighted - par_str4(i).Orient_T_R_Weighted;
end
Ori_T_Diff_GA = mean(Ori_T_Diff_Mean);
Ori_T_Diff_SE = std(Ori_T_Diff_Mean);
% output structured as follows
% 1|index of trial
% 2|incorrect gabor position
% 3|counterclockwise gabor orientation
% 4|difference between counterclockwise and incorrect gabor
% 5|incorrect orientation
% 6|difference between clockwise and incorrect gabor
% 7|clockwise gabor orientation
% 8|Reaction Time
% Plots
% Reaction time versus difference in degree of left gabor orientation
% fig = figure;
% scatter(Orient_T(4,:),Orient_T(8,:))
% title('RT and Difference of Correct and Clockwise Flanking Gabor');
% xlabel('Angle Difference (degrees)');
% ylabel('Reaction Time (ms)');
%% Looking at the incorrect trial gabor orientation as a function of correct gabor orientation
figure('Position',[25,25,1000,1000]);
widthHeight = ceil(sqrt(nsubs));
for i_subs = 1:nsubs
count = 0;
current_sub = sub_nums{i_subs};
par_str5(i_subs).Orient_Cor = zeros(8,lengthy);
%Find output filename
Filename = dir(['.\Data\' current_sub '*']);
load(['.\Data\' Filename.name]);
for i = 1:lengthy
if isnan(out_incorrect_gabor(i)) ~= true
count = count + 1;
par_str5(i_subs).Orient_Cor(1,count) = i; par_str5(i_subs).Orient_Cor(2,count) = out_incorrect_gabor(i);
par_str5(i_subs).Orient_Cor(3,count) = out_rotation{i}(trialList(i,1)); % correct gabor
par_str5(i_subs).Orient_Cor(4,count) = out_rotation{i}(par_str5(i_subs).Orient_Cor(2,count)); % incorrect gabor
normDeg = mod(par_str5(i_subs).Orient_Cor(3,count) - par_str5(i_subs).Orient_Cor(4,count),360);
par_str5(i_subs).Orient_Cor(5,count) = min(360-normDeg, normDeg);
par_str5(i_subs).Orient_Cor(6,count) = out_RT(i);
par_str5(i_subs).Orient_Cor(7,count) = out_soa(i);
% par_str5(i_subs).Orient_Cor(7,count) = [[ColorMap(out_soa(i))]];
end
end
par_str5(i_subs).Orient_Count = count;
% Look at correlating individual reaction times under 2 seconds with
% overall difference sums for each SOA (different colours
par_str5(i_subs).Orient_Cor_Sum = sum(par_str5(i_subs).Orient_Cor(5,:));
par_str5(i_subs).Orient_Cor_Weighted = par_str5(i_subs).Orient_Cor_Sum/count;
par_str5(i_subs).Orient_Cor_Diff = sum(par_str5(i_subs).Orient_Cor(5,:));
par_str5(i_subs).Orient_Cor_std = std(par_str5(i_subs).Orient_Cor(5,:));
% subplot(widthHeight,widthHeight,i_subs);
% % c = gradient(y);
% % c = par_str5(i_subs).Orient_Cor(7,count);
% scatter(par_str5(i_subs).Orient_Cor(5,1:count),par_str5(i_subs).Orient_Cor(6,1:count),[],par_str5(i_subs).Orient_Cor(7,1:count), 'filled')
% % scatter(par_str5(i_subs).Orient_Cor(5,:),par_str5(i_subs).Orient_Cor(6,),'b')
% legend({'Counterclockwise','Clockwise'});
% xlim([0 180]);
% set(gca,'XTick',0:20:180)
% xlabel('Incorrect Gabor Orientation Difference')
% ylabel('Reaction Time')
% title(current_sub)
% end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
subplot(widthHeight,widthHeight,i_subs);
% % c = gradient(y);
% % c = par_str5(i_subs).Orient_Cor(7,count);
% % scatter(par_str5(i_subs).Orient_Cor(5,:),par_str5(i_subs).Orient_Cor(6,:),par_str5(i_subs).Orient_Cor(7,count))
% % scatter(par_str5(i_subs).Orient_Cor(5,:),par_str5(i_subs).Orient_Cor(6,:),'b')
for i_point=1:count
hold on
% Get the color for this subject from the summer colormap.
% markerColour = ColorMap(i_subj,:);
plot(par_str5(i_subs).Orient_Cor(5,i_point), par_str5(i_subs).Orient_Cor(6,i_point),'sk','markersize',8,'markerfacecolor',ColorMap(par_str5(i_subs).Orient_Cor(7,i_point)));
end
% for i=1:length(par_str5(i_subs).Orient_Cor(6,:))
% %Select color
% if par_str5(i_subs).Orient_Cor(6,i) < 0
% mycolor = 'r';
% else
% mycolor = 'g';
% end
% plot(par_str5(i_subs).Orient_Cor(5,i), par_str5(i_subs).Orient_Cor(6,i), 'sk','markersize',8,'markerfacecolor',mycolor);
% end
legend({'Counterclockwise','Clockwise'});
xlim([0 180]);
set(gca,'XTick',0:20:180)
xlabel('Incorrect Gabor Orientation Difference')
ylabel('Reaction Time')
title(current_sub)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ori_Cor_Diff_Mean = zeros(1,nsubs);
for i = 1:nsubs
Ori_Cor_Diff_Mean(i) = par_str5(i).Orient_Cor_Weighted;
end
Ori_Cor_Diff_GA = mean(Ori_Cor_Diff_Mean);
Ori_Cor_Diff_SE = std(Ori_Cor_Diff_Mean);
% Look at reaction time as a function of correct gabor orientation
% output structured as follows
% 1|index of trial
% 2|incorrect gabor position
% 3|correct orientation
% 4|incorrect orientation
% 5|difference between correct and incorrect
% % Plots
% fig = figure;
% scatter(Orient_Cor(5,:),Orient_Cor(6,:))
% title('RT and Difference of Correct and Incorrect Gabor Orientation');
% xlabel('Angle Difference (degrees)');
% ylabel('Reaction Time (ms)');
%%
[x,y,z] = peaks;
z = max(peaks* 100000, 0);
cmap = [1 1 1; 1 0 0; 1 .5 0; 1 1 0; 0 1 0];
lbl = {'0', '1-6400','6400-80000', '80001-500000', '500000+'};
[n,bin] = histc(z, [0 1 6400 80000 500000 Inf]);
pcolor(x,y,bin);
colormap(cmap);
for ii = 1:size(cmap,1)
p(ii) = patch(NaN, NaN, cmap(ii,:));
end
legend(p, lbl);
cb = colorbar;
set(cb, 'ticks', 1:5, 'ticklabels', lbl);
set(gca, 'clim', [0.5 5.5]);