Capture reaction time - code not working
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!