-
Notifications
You must be signed in to change notification settings - Fork 0
/
Example.m
56 lines (40 loc) · 1.34 KB
/
Example.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
% sample file to design a experiment
% Setting the global by default
neuronpsy.init.global;
% Setting the experiment parameters
% you may use the gui
Example.init.gui;
% or not
Example.init.parameters;
% run experiment
for block = 1:EXP.block
try
Example.trial();
% check the break command trial by trial
neuronpsy.procedure.checkEscape();
neuronpsy.procedure.checkBreak();
% step1 show fixation alone
neuronpsy.io.send.mark();
neuronpsy.stim.fixation();
% step2 show heading
neuronpsy.io.send.mark();
neuronpsy.stim.heading(); % or your Example.stim.XX()
% step3 show choice
neuronpsy.io.send.mark();
neuronpsy.stim.choice(); % or your Example.stim.XX()
neuronpsy.procedure.checkResponse();
% step4 give reward
neuronpsy.io.reward();
% then record data
neuronpsy.procedure.checkTrial();
neuronpsy.io.write.trialInfo();
neuronpsy.procedure.trialRest();
catch trialException
if neuronpsy.exception.handle(trialException)
elseif Example.exception.handle(trialException)
else
end
end
Example.procedure.blockRest();
end
neuronpsy.procedure.endExperiment();