Skip to content

Commit b9b87ae

Browse files
committed
add check previous is target
1 parent c95fff4 commit b9b87ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

visualMotionLocalizer.m

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

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

@@ -99,6 +100,10 @@
99100
['start_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
100101

101102
if ~strcmp(cfg.target.type, 'static_repeat')
103+
% we want to initialize the dots position when targets type is fixation cross
104+
% or if this the first event of a target pair
105+
if ~strcmp(cfg.target.type, 'static_repeat') || ...
106+
thisEvent.target ~= previousEvent.target
102107
dots = [];
103108
end
104109
% play the dots and collect onset and duraton of the event
@@ -124,6 +129,8 @@
124129
eyeTracker('Message', cfg, ...
125130
['end_trial-', num2str(iEvent), '_', thisEvent.trial_type]);
126131

132+
previousEvent = thisEvent;
133+
127134
waitFor(cfg, cfg.timing.ISI);
128135

129136
end

0 commit comments

Comments
 (0)