我想要在屏幕上显示刺激1,如果做出特定的响应1,则显示刺激2,然后用户需要按下特定的键(响应2),当他们这样做时,他们会看到刺激3。我能够在显示刺激1的同时,根据响应1来显示刺激2。如何解决这个问题?提前感谢
%presenting text 1
Screen('DrawText',window,'stimuli1',xcen,ycen);
Screen('Flip',window)
%intiating keyboard
[keyIsDown, RTkeyCode] = KbWait;
r=find(RTkeyCode);%this should be the code for the key pressed
response=KbName(r);%Figure out what key strong text
Screen('TextSize',window,60)
Screen('DrawText',window,'question',xcen,ycen);
Screen('Flip',window)
WaitSecs(2)
if response=='b'
Screen('DrawText',window,'stmuli2',xcen,ycen)
Screen('Flip',window)
end
end发布于 2021-01-26 06:43:40
您可以尝试一些解决方案。
KbWait(-1); WaitSecs(2);等待按键,然后在按键应该被抬起的几秒钟后,使用一些命令来帮助清除存储的响应,如KbEventFlush(deviceIndex); to look for additional help is PsychToolboxes KbQueueDemo.m script。
https://stackoverflow.com/questions/60283415
复制相似问题