Skip to content

Commit

Permalink
edit number of trials
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemrupp committed Sep 24, 2024
1 parent 80e6194 commit 6e942b2
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions private/load_events.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

% fprintf('# loading event timing\n');

nblocks = 3;
ntrials = 50;
i = 0;
nblocks = 4;
ntrials = [36,36,72,72];
i = 0;

for block = 1:nblocks
for trial = 1:ntrials
for trial = 1:ntrials(block)

% Randomly select two different options from 'left', 'up', and 'right'
all_choices = {'left', 'up', 'right'};
Expand All @@ -17,20 +17,23 @@
timing(i).event_name = 'choice';
timing(i).func = @choice;
timing(i).dur = 2;

% Set chance values depending on the block
if block == 1
timing(i).chance = [.2,.5,.5,1]; % left, up, up,right
elseif block == 2
timing(i).chance = [0.5,0.2,0.2,1]; % left, up, up,right since rtbox has 2 options for up
elseif block == 3
timing(i).chance = [0.75,0.75,0.75,0.75]; % left, up,up, right
elseif block == 4
timing(i).chance = [1,1,1,1]; % left, up,up, right

end

timing(i).max_rt = timing(i).dur;
timing(i).i = i;
timing(i).choices = selected_choices; % Assign the random choices to this trial

if i>1
timing(i).onset = timing(i-1).onset + timing(i-1).dur; % as soon as choice ends
else
Expand Down

0 comments on commit 6e942b2

Please sign in to comment.