-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcrdm_define_conditions.m
More file actions
104 lines (95 loc) · 5.47 KB
/
crdm_define_conditions.m
File metadata and controls
104 lines (95 loc) · 5.47 KB
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
function blocks = crdm_define_conditions( conditionSequence, options )
%CRDM_DEFINE_CONDITIONS This function defines each condition used in the
%continuous random dot motion paradigm in one session. It takes in a
%sequence of conditions (a vector of integers) and defines all the settings
%that define each of these numbers. You can implement different versions of
%this and indicate in the main options which one you want to use.
switch options.design.designLabel
case 'coherence variance'
% condition 1: variance is low, condition 2: variance is high
for iBlock = 1: numel(conditionSequence)
switch conditionSequence(iBlock)
case 1
blocks(iBlock).condition = 1;
blocks(iBlock).conditionLabel = 'lowVar';
blocks(iBlock).instruct.text = 'Variance is low.';
blocks(iBlock).iti.sd = 0.2;
blocks(iBlock).trial.sd = 0.2;
blocks(iBlock).trial.cohList = [-0.2 -0.1 0.1 0.2];
case 2
blocks(iBlock).condition = 2;
blocks(iBlock).conditionLabel = 'highVar';
blocks(iBlock).instruct.text = 'Variance is high.';
blocks(iBlock).iti.sd = 0.5;
blocks(iBlock).trial.sd = 0.5;
blocks(iBlock).trial.cohList = [-0.3 -0.2 0.2 0.3];
end
% condition-independent settings
blocks(iBlock).iti.minSec = options.design.iti.minSec; % use 1.5
blocks(iBlock).iti.maxSec = options.design.iti.maxSec; % use 15
blocks(iBlock).iti.meanSec = options.design.iti.meanSec; % use 5
blocks(iBlock).trial.lengthSec = options.design.trial.duration; % use 4
% make these block-specific if you want to signal the current
% condition by the size/shape of the fixation dot:
blocks(iBlock).fixDot.sizeDeg = options.vStim.fixSize(1);
blocks(iBlock).fixDot.shape = 'C'; % circle (C) vs. square (S)
end
case 'trial frequency'
% condition 1: trials are rare, condition 2: trials are frequent
for iBlock = 1: numel(conditionSequence)
switch conditionSequence(iBlock)
case 1
blocks(iBlock).condition = 1;
blocks(iBlock).conditionLabel = 'rare';
blocks(iBlock).iti.minSec = 5;
blocks(iBlock).iti.maxSec = 25;
blocks(iBlock).iti.meanSec = 15;
blocks(iBlock).instruct.text = 'Trials are rare.';
case 2
blocks(iBlock).condition = 2;
blocks(iBlock).conditionLabel = 'frequent';
blocks(iBlock).iti.minSec = 1.5;
blocks(iBlock).iti.maxSec = 10;
blocks(iBlock).iti.meanSec = 5;
blocks(iBlock).instruct.text = 'Trials are frequent.';
end
% condition-independent settings
blocks(iBlock).iti.sd = options.design.iti.sd; % use 0.5
blocks(iBlock).trial.lengthSec = options.design.trial.duration; % use 4
blocks(iBlock).trial.cohList = options.design.trial.cohList; % use [-0.5 -0.4 -0.3 0.3 0.4 0.5]
blocks(iBlock).trial.sd = options.design.trial.sd; % use 0.3
% make these block-specific if you want to signal the current
% condition by the size/shape of the fixation dot:
blocks(iBlock).fixDot.sizeDeg = options.vStim.fixSize(1);
blocks(iBlock).fixDot.shape = 'C'; % circle (C) vs. square (S)
end
case 'trial length'
% condition 1: trials are short (and strong), condition 2: trials
% are long (and weak)
for iBlock = 1: numel(conditionSequence)
switch conditionSequence(iBlock)
case 1
blocks(iBlock).condition = 1;
blocks(iBlock).conditionLabel = 'short';
blocks(iBlock).instruct.text = 'Trials are short.';
blocks(iBlock).trial.lengthSec = 2.5;
blocks(iBlock).trial.cohList = [-0.6 -0.5 -0.4 0.4 0.5 0.6];
case 2
blocks(iBlock).condition = 2;
blocks(iBlock).conditionLabel = 'long';
blocks(iBlock).instruct.text = 'Trials are long.';
blocks(iBlock).trial.lengthSec = 6;
blocks(iBlock).trial.cohList = [-0.4 -0.3 -0.2 0.2 0.3 0.4];
end
% condition-independent settings
blocks(iBlock).iti.sd = options.design.iti.sd; % use 0.5
blocks(iBlock).iti.minSec = options.design.iti.minSec; % use 1.5
blocks(iBlock).iti.maxSec = options.design.iti.maxSec; % use 15
blocks(iBlock).iti.meanSec = options.design.iti.meanSec; % use 5
blocks(iBlock).trial.sd = options.design.trial.sd; % use 0.3
% make these block-specific if you want to signal the current
% condition by the size/shape of the fixation dot:
blocks(iBlock).fixDot.sizeDeg = options.vStim.fixSize(1);
blocks(iBlock).fixDot.shape = 'C'; % circle (C) vs. square (S)
end
end