|
Does run_scene pause the script until completion? January 31, 2020 02:58PM | Registered: 6 years ago Posts: 12 |
ec_options_on = 0;
ec_option_chosen = 1;
ec_no_option_chosen = 2;
% Build scene
f1 = SingleTarget(joy_);
f1.Target = curr_options(1);
f1.Threshold = [3 2];
fth1 = FreeThenHold(f1);
fth1.MaxTime = choice_timeout;
fth1.HoldTime = choice_hold_time;
or = OrAdapter(fth1);
f2 = SingleTarget(joy_);
f2.Target = curr_options(2);
f2.Threshold = [3 2];
fth2 = FreeThenHold(f2);
fth2.MaxTime = choice_timeout;
fth2.HoldTime = choice_hold_time;
or.add(fth2);
scene = create_scene(or, [curr_options]);
% Signal scene about to start
eventmarker(ec_options_on );
% Start scene
run_scene(scene);
% Signal choice made (approximate RT measure)
eventmarker(ec_option_chosen);function give_reward(amount) eventmarker(ec_pump_on) goodmonkey(amount); eventmarker(ec_pump_off) end
|
Re: Does run_scene pause the script until completion? February 01, 2020 12:07AM | Admin Registered: 7 years ago Posts: 1,007 |
stimulus_onset_time = run_scene(scene, marker_for_stimulus_onset); time_of_joystick_acquisition = []; if fth1.Success, time_of_joystick_acquisition = fth1.AcquiredTime; end if fth2.Success, time_of_joystick_acquisition = fth2.AcquiredTime; end if ~isempty(time_of_joystick_acquisition), rt = time_of_joystick_acquisition - stimulus_onset_time; end
|
Re: Does run_scene pause the script until completion? February 01, 2020 10:10AM | Registered: 6 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.