Newer
Older
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
blockVec = 0:20:size(trialData,2);
for block = 1:numel(blockVec)-1
curData = trialData(blockVec(block)+1:blockVec(block+1));
lowTrials = find([curData.level] == 0.0050);
intTrials = find([curData.level] == 0.0100);
highTrials = find([curData.level] == .07);
acc(1,block) = nanmean([curData(lowTrials).correct]);
acc(2,block) = nanmean([curData(intTrials).correct]);
acc(3,block) = nanmean([curData(highTrials).correct]);
rt(1,block) = nanmean([curData(lowTrials).rxtime]);
rt(2,block) = nanmean([curData(intTrials).rxtime]);
rt(3,block) = nanmean([curData(highTrials).rxtime]);
end;
% plots
figure;
subplot(2,1,1);
plot(acc'); legend({'low'; 'int'; 'high'});
subplot(2,1,2);
plot(rt'); legend({'low'; 'int'; 'high'});
% images
figure;
subplot(2,1,1);
imagesc(acc); title('Accuracy'); colorbar;
subplot(2,1,2);
imagesc(rt); title('RTs'); colorbar;
%% sort by mean contrast
blockVec = 0:36:size(trialData,2);
for block = 1:numel(blockVec)-1
curData = trialData(blockVec(block)+1:blockVec(block+1));
lowTrials = find([curData.level] == .01);
intTrials = find([curData.level] == .03);
highTrials = find([curData.level] == .06);
levels = {'lowTrials'; 'intTrials'; 'highTrials'};
for indLevel = 1:numel(levels)
acc(indLevel,block) = nanmean([curData(eval(levels{indLevel})).correct]);
rt(indLevel,block) = nanmean([curData(eval(levels{indLevel})).rxtime]);
end;
end;
lowMean = find(checkerInfo.contrastBlocks ==.2);
interMean = find(checkerInfo.contrastBlocks ==.5);
highMean = find(checkerInfo.contrastBlocks ==.8);
figure;
subplot(2,3,1);
imagesc(acc(:,lowMean)); title('Accuracy'); colorbar;
subplot(2,3,2);
imagesc(acc(:,interMean)); title('Accuracy'); colorbar;
subplot(2,3,3);
imagesc(acc(:,highMean)); title('Accuracy'); colorbar;
subplot(2,3,4);
imagesc(rt(:,lowMean)); title('RTs'); colorbar;
subplot(2,3,5);
imagesc(rt(:,interMean)); title('RTs'); colorbar;
subplot(2,3,6);
imagesc(rt(:,highMean)); title('RTs'); colorbar;
% show as plots
figure;
subplot(2,3,1);
plot(acc(:,lowMean)'); legend({'low'; 'int'; 'high'}); ylim([0 1]); xlim([1 6]);
title('Accuracy: .2 mean contrast');
subplot(2,3,2);
plot(acc(:,interMean)'); legend({'low'; 'int'; 'high'}); ylim([0 1]); xlim([1 6]);
title('Accuracy: .5 mean contrast');
subplot(2,3,3);
plot(acc(:,highMean)'); legend({'low'; 'int'; 'high'}); ylim([0 1]); xlim([1 6]);
title('Accuracy: .8 mean contrast');
subplot(2,3,4);
plot(rt(:,lowMean)'); legend({'low'; 'int'; 'high'}); ylim([0 2.5]); xlim([1 6]);
title('RT: .2 mean contrast');
subplot(2,3,5);
plot(rt(:,interMean)'); legend({'low'; 'int'; 'high'}); ylim([0 2.5]); xlim([1 6]);
title('RT: .5 mean contrast');
subplot(2,3,6);
plot(rt(:,highMean)'); legend({'low'; 'int'; 'high'}); ylim([0 2.5]); xlim([1 6]);
title('RT: .8 mean contrast');
set(findall(gcf,'-property','FontSize'),'FontSize',18)