【发布时间】:2018-08-24 18:51:52
【问题描述】:
对于我的实验,我想向参与者提供刺激和一些指示。然后 2 秒后,我希望刺激消失,但指示保持不变,直到参与者做出反应。参与者应该能够在刺激呈现后立即做出反应,并且在呈现刺激后最多 10 秒内做出反应。响应时间将被记录。
使用我当前的代码,参与者在 2 秒后(刺激消失后)才能做出反应。是否有某种方式让刺激仅出现 2 秒,而说明仍保留在屏幕上,但参与者能够在刺激呈现后立即做出反应?
%Show the instructions and the stimulus
Screen('DrawTexture', window, randFaceTexture2);
DrawFormattedText(window, [instructions1], 'center', 600)
stimTime = Screen('Flip', window);
WaitSecs(2);
%Stimulus disappears but instructions remain
DrawFormattedText(window, [instructions1], 'center', 600)
Screen('Flip', window);
if GetSecs() <= stimTime + 10
keyIsDown = 0;
startTime = GetSecs();
while 1
[keyIsDown, secs, keyCode] = KbCheck;
FlushEvents('keyDown');
if keyIsDown
nKeys = sum(keyCode);
if nKeys == 1
if keyCode(yes) || keyCode(no)
reactionTime = 1000*(GetSecs - startTime);
response = KbName(keyCode);
Screen('Flip', window);
break;
elseif keyCode(escKey)
ShowCursor;
fclose(outfile);
Screen('CloseAll');
return
end
keyIsDown = 0;
keyCode = 0;
end
end
end
else
line3 = 'Sorry you''re out of time';
DrawFormattedText(window, line3, 'center', 'center');
Screen('Flip', window);
keyIsDown = 0;
rt = 0;
end
【问题讨论】:
标签: octave response-time psychtoolbox