|
occasionally Time from SingleTarget is empty, and a timing question May 29, 2024 06:43PM | Registered: 4 years ago Posts: 12 |
stim_fix = SingleTarget(eye_); stim_fix.Target = [0, 0]; stim_fix.Threshold = center_fix_window; stim_fix_con = Concurrent(stim_fix); stim_fix_con.add(fix_image); stim_hold_fix = WaitThenHold(stim_fix_con); stim_hold_fix.WaitTime = 0; stim_hold_fix.HoldTime = stim_on_time; joy_stim = SingleTarget(joy_); joy_stim.Target = [0 0]; joy_stim.Threshold = joy_threshold_this_trial; %succcess when within threshold joy_stim_moved = NotAdapter(joy_stim); %success when outside threshold joy_wth_stim = WaitThenHold(joy_stim_moved); %wait until time elapsed or joystick moves joy_wth_stim.WaitTime = stim_on_time; joy_wth_stim.HoldTime = 0; %stops when joystick moved or wait time elapsed %success if joystick moved keep_going_stim = AllContinue(stim_hold_fix); %keep going unless fixat keep_going_stim.add(joy_wth_stim); also_images_stim = Concurrent(keep_going_stim); also_images_stim.add(stimulus_emo_img); also_images_stim.add(Gabor_img); stim_scene = create_scene(also_images_stim);
stim_start = run_scene(stim_scene, stim_start_mk);
if ~stim_hold_fix.Success ... %failed fixation during stimulus presentation
&& ~joy_wth_stim.Success %this needed because if scene ended due to joystick move,
% there would be no fixation success
%but it does not mean there was a fixation fail!
eventmarker(fix_failed_stim_mk);
trialerror(1); %repeat trial
trial_result = result_fix_failed_stim; %failed fixation during stimuli
do_fix_timeout = true;
dashboard(2, 'fixation during stimuli failed', [1 0 1]);
idle(0);
% nested_report
else %fixation fine during stimuli
if joy_wth_stim.Success %if joystick moved during stimuli, finish trial
eventmarker(joystick_go_stim_mk);
joy_go = true; %joystick moved
trial_complete = true;
RT = joy_stim.Time - stim_start; %RT re stimulus onset
%fprintf('RT %g\n', RT);
dashboard(2, 'joystick moved during stimuli', [1 1 0]);
idle(0);
% nested_report|
Re: occasionally Time from SingleTarget is empty, and a timing question May 29, 2024 08:47PM | Admin Registered: 6 years ago Posts: 999 |
|
Re: occasionally Time from SingleTarget is empty, and a timing question May 30, 2024 02:31PM | Registered: 4 years ago Posts: 12 |
|
Re: occasionally Time from SingleTarget is empty, and a timing question May 30, 2024 08:11PM | Admin Registered: 6 years ago Posts: 999 |
|
Re: occasionally Time from SingleTarget is empty, and a timing question May 31, 2024 04:20AM | Registered: 4 years ago Posts: 12 |
|
Re: occasionally Time from SingleTarget is empty, and a timing question May 31, 2024 03:18PM | Admin Registered: 6 years ago Posts: 999 |
|
Re: occasionally Time from SingleTarget is empty, and a timing question May 31, 2024 09:15PM | Registered: 4 years ago Posts: 12 |
The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.