Problem with nonblocking in goodmonkey March 02, 2022 09:46PM |
Registered: 2 years ago Posts: 16 |
%reward if 0==error_type %fix.success idle(0,[]); goodmonkey(1000, 'numreward', 5, 'pausetime', 300, 'eventmarker', 40,'nonblocking', 1); run_scene(scene_mov); %second movie scene end if 1== error_type %ct.sucess idle (3500,[]); end trialerror(error_type);
Re: Problem with nonblocking in goodmonkey March 03, 2022 12:46AM |
Admin Registered: 5 years ago Posts: 878 |
Re: Problem with nonblocking in goodmonkey March 06, 2022 09:27PM |
Registered: 2 years ago Posts: 16 |
if ~exist('touch_','var'), error('This demo requires touch input. Please enable it in the main menu or try the simulation mode.'); end hotkey('x', 'escape_screen(); assignin(''caller'',''continue_'',false);'); hotkey('r', 'goodmonkey(1000, ''numreward'', 1);'); % manual reward %event codes bhv_code(10,'touched the screen',20,'reward',30,'go',40,'reward') %bhv_variable('direction',direction); %Editiable touch_radius = 100000; step = 100; max_reaction_time= 2000; target = [1]; stepunit='100'; editable('touch_radius','max_reaction_time','step','stepunit'); %choose directions switch mod(TrialRecord.CurrentTrialNumber-1,8) case 0 %up to down Condition = 1; x = linspace(0,0,1000)'; y = linspace(9,-9,1000)'; case 1 %down to up Condition =2; x = linspace(0,0,1000)'; y = linspace(-9,9,1000)'; case 2 %left to right Condition=3; x = linspace(18,-18,1000)'; y = zeros(1000,1); case 3 % right to left Condition =4; x = linspace(-18,18,1000)'; y = zeros(1000,1); case 4 % down left to up right Condition= 5; x = linspace(-18,18,1000)'; y = linspace(-9,9,1000)'; case 5 % down right to left up Condition= 6; x = linspace(18,-18,1000)'; y = linspace(-9,9,1000)'; case 6 % up right to down left Condition = 7; x = linspace(18,-18,1000)'; y = linspace(9,-9,1000)'; case 7 % up left to down right Condition = 8; x = linspace(-18,18,1000)'; y = linspace(9,-9,1000)'; end %scene 1 ct = CurveTracer(touch_); ct.Trajectory= [x y]; ct.Target= target; fix=SingleTarget(ct); fix.Threshold= touch_radius; or = OrAdapter(ct); % Finish either when all trajectory coordinates are used or.add(fix); % or fixation is acquired. scene1 = create_scene(or,target); %scene 2 with flashing LED mov= MovieGraphic(null_); mov.List= { 'Changing LED.mpg', [0 0],true,3}; % movie filename tc= TimeCounter(mov); tc.Duration= 5000; scene_mov= create_scene(tc); %run task running= true; rp = fix.Position; % Assign rt for the position graph error_type = 0; run_scene(scene1,10); trialerror(error_type); if fix.Success error_type=0; end if ct.Success error_type=1; end %reward if 0==error_type %fix.success idle(0,[]); goodmonkey(100, 'numreward', 5, 'pausetime', 300, 'eventmarker', 40,'nonblocking', 1); run_scene(scene_mov); end if 1== error_type %ct.sucess idle (3500,[]); end trialerror(error_type);
Re: Problem with nonblocking in goodmonkey March 06, 2022 09:38PM |
Admin Registered: 5 years ago Posts: 878 |
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.