-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimulatedTask.m
More file actions
35 lines (26 loc) · 1.01 KB
/
simulatedTask.m
File metadata and controls
35 lines (26 loc) · 1.01 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
function [names,onsets,durations] = simulatedTask()
% this function models our working memory task
trialsPerLoadLevel = 40;
TR=1.925;
fixationTimeInScans= 3.5/TR;
StimulusTimeInScans= 0.8/TR;
retentionShortTimeInScans=2/TR;
retentionLongTimeInScans=4/TR;
totalTimeInScans=0;
for n=1:trialsPerLoadLevel
preRentionTimeInScans=fixationTimeInScans+StimulusTimeInScans;
totalTimeInScans=totalTimeInScans+preRentionTimeInScans;
onsets{1}(n)=totalTimeInScans;
retrievalTime=(1.7*rand(1,1)+0.3)/TR;
totalTimeInScans=totalTimeInScans+...
retentionShortTimeInScans+retrievalTime;
durations{1}(n)=retentionShortTimeInScans+retrievalTime;
totalTimeInScans=totalTimeInScans+preRentionTimeInScans;
retrievalTime=(1.7*rand(1,1)+0.3)/TR;
onsets{2}(n)=totalTimeInScans;
totalTimeInScans=totalTimeInScans+...
retentionLongTimeInScans+retrievalTime;
durations{2}(n)=retentionLongTimeInScans+retrievalTime;
end
names{1}='retentionLow';
names{2}='retentionHigh';