Welcome! Log In Create A New Profile

Advanced

Time control

Posted by Song_Moore 
Time control
August 21, 2019 04:59PM
Hi, I am trying to let the monkey move the cursor after delay. The time period it moves cursor after delay is called "reaction time". I want to set up that when cursor is moved from the center 4 distance away, the reaction time finishes, and the next time period starts. There is a time limit which is 5 seconds. If the cursor is not moved outward 4 distance from center within 5 seconds, abort experiment. And the moment cursor is moved outside the 4 distance away from center, reaction time stops and next time recording starts.

I thought to use

chosen_target = eyejoytrack('acquiretarget', [target], fix_radius, max_reaction_time);,

but it can only last for 5 seconds and then let me compare if the position joystick is far enough. I cannot stop reaction time at the moment when I move 4 distance away from the center by using this command alone. Any suggestion?
Re: Time control
August 22, 2019 12:28AM
You didn't provide enough information. You should've shown at least the values of variables, the location of the target and the initial position of the cursor.

By the way, the term, 'reaction time', has a very specific meaning in psychology and neuroscience. I would use a different name, like 'response period'.
Re: Time control
August 22, 2019 10:35AM
Sorry for the confusion.

The real-time position of the joystick is (x, y).
The cursor is initially at the center (0, 0) during the delay period. When the delay period ends, a response period starts, and this response period lasts for 5000 ms. I am trying to record the time length a monkey needs to move the cursor to 4 units away within 5000 ms.
If the monkey fails to move the cursor 4 units distance away from the center (0, 0) within the response period, which means the position of joystick position remains (x < 4, 0) after 5000 ms, the task aborts.
As soon as the monkey moves the cursor 4 units away from the center (x >= 4, 0) or (x <= -4, 0), the response period is interrupted to stop. A new time period starts.

I hope this helps to clarify my question.
Re: Time control
August 22, 2019 11:09AM
What I don't understand is the part, "... but it can only last for 5 seconds". If the target and the cursor are both at [0 0] and the tracking type is 'acquiretarget', eyejoytrack ends as soon as you run it. How could it last for 5 s?

From your description, I guess this is what you tried to do.
[ontarget, rt] = eyejoytrack('holdtarget', target, 4, 5000);  % target is at [0 0]
if ontarget, return, end  % The cursor did not escape the window in time, so abort the trial
Re: Time control
August 22, 2019 02:55PM
For example, if there is a target at (10, 0), and the cursor starts at (0, 0). I want to move the cursor from (0,0) to (10, 0).

After the delay period, a response period begins, which will last for 5 seconds, and the cursor begins to move away from the center position.

If the cursor does not move above x = 4 within 5 seconds, the trial is aborted. [This is the part you showed and I can understand now.]

As soon as the cursor moves above x = 4, the response time ends even it has not been 5 seconds. [This is the part I don't know how to do.]
Re: Time control
August 22, 2019 04:26PM
I attach a complete version of the above code. Please run it on NIMH ML and let me know again which part you think I showed you.
Attachments:
open | download - Song Moore.zip (630 bytes)
Re: Time control
August 22, 2019 05:36PM
Hi Jaewon,

Thank you so much for showing the file! It helped a lot! I was confused a little bit about how "eyejoytrack('holdtarget', target, 4, 5000);" works after you showed me, but it became so much clearer when I tried your code. Thank you!

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.