Effacer les filtres
Effacer les filtres

Capture reaction time - code not working

3 vues (au cours des 30 derniers jours)
Chelsea
Chelsea le 3 Mar 2015
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!

Réponses (0)

Catégories

En savoir plus sur Timing and presenting 2D and 3D stimuli dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by