Skip to content

Commit 039b2db

Browse files
committed
keep track of the type of previous target
1 parent b9b87ae commit 039b2db

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

visualMotionLocalizer.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
eyeTracker('Message', cfg, ['start_block-', num2str(iBlock)]);
8080
dots=[];
81-
previousEvent.target = [];
81+
previousEvent.target = 0;
8282
% For each event in the block
8383
for iEvent = 1:cfg.design.nbEventsPerBlock
8484

@@ -99,13 +99,14 @@
9999
eyeTracker('Message', cfg, ...
100100
['start_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
101101

102-
if ~strcmp(cfg.target.type, 'static_repeat')
103102
% we want to initialize the dots position when targets type is fixation cross
104103
% or if this the first event of a target pair
105-
if ~strcmp(cfg.target.type, 'static_repeat') || ...
106-
thisEvent.target ~= previousEvent.target
104+
if strcmp(cfg.target.type, 'static_repeat') && ...
105+
thisEvent.target == previousEvent.target
106+
else
107107
dots = [];
108108
end
109+
109110
% play the dots and collect onset and duraton of the event
110111
[onset, duration, dots] = doDotMo(cfg, thisEvent, thisFixation, dots);
111112

@@ -129,7 +130,7 @@
129130
eyeTracker('Message', cfg, ...
130131
['end_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
131132

132-
previousEvent = thisEvent;
133+
previousEvent = thisEvent;
133134

134135
waitFor(cfg, cfg.timing.ISI);
135136

0 commit comments

Comments
 (0)