我在 MATLAB 中使用 psychtoolbox,我想让参与者从 0-9 对一串图像的失真进行评分。我试过使用 GetChar,但是当我运行脚本时,它不会等待用户给出响应,而是移动到下一个屏幕。关于如何解决这个问题的任何建议?
%using a loop to show images
for k=1:290
texture1(k)=Screen('MakeTexture',w,images{k});
end
for k=1:145
Screen('DrawTexture',w, texture1(k), [], leftposition);
Screen('DrawTexture',w, texture1(k+145), [], rightposition);
Screen('DrawLines', w, allCoords,...
lineWidthPix, black, [xCenter yCenter], 2);
Screen(w,'Flip');
pause(0.2);
end
%rating text
DrawFormattedText(w,'Rate distortion 0-9','center','center',[255 255 255]);
Screen(w,'Flip');
GetChar();
%press space to finish
DrawFormattedText(w,'press space to finish','center','center',[255 255 255]);
Screen(w,'Flip');
% Wait for a key press
KbStrokeWait;
% Clear the screen
sca;