Capture reaction time - code not working

1 次查看(过去 30 天)
Hi,
I'm trying to capture simple reaction time, but the code I have isn't working (i.e., gives me RT of 0.00000008, etc.).
Here is what I have...
secs0=GetSecs; % Wait for a keyboard response
respToBeMade = true;
while respToBeMade
[keyIsDown,secs, pressedKeys] = KbCheck;
if pressedKeys(escapeKey);
ShowCursor;
sca;
return;
elseif pressedKeys(upKey);
keyResp = 's';
respToBeMade = false;
elseif pressedKeys(downKey);
keyResp = 'l';
respToBeMade = false;
end
end
RT=secs-secs0; % Get reaction time
Is there something that is clearly wrong here? I can't seem to figure it out, it looks right to me. I'm also using Psychtoolbox if that makes a difference.
Thank you!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Timing and presenting 2D and 3D stimuli 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by