Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Feedback for the second stimulus does not show up

조회 수: 2 (최근 30일)
xxxx1017
xxxx1017 2019년 3월 18일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi guys,
I have been trying to run an experiment with the Simon task on Matlab. In this study, I'm going to have two stimuli (hereafter, S1 and S2). However, when I tried to run the experiment, the feedback for S2 does not show up as expected even if the code for S2 is similar to the code for S1. In each trial, S2 appears on screen until the presentation limit for S2 no matter what key I have pressed. Could anyone tell me where the problem is? Thanks!
%Here is the script for S1
if RespKey1 == -1
textmessage = 'Please press the homekey!';
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
elseif RespKey1 == OneTrtyInfo.R1 & RT1 < Tar1_limit & RT1 > MinRT1
textmessage = 'Correct';
disp(textmessage)
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC1 = 1;
ErrorCode = 0;
elseif RespKey1 ~= OneTrtyInfo.R1
textmessage =['Error: The correct response was ' R1 ];
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC1 = 0;
PC2 = 0;
ErrorCode = ErrorCode + 1;
elseif RT1 > Tar1_limit
textmessage = 'Your response was too slow! Please respond faster.';
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC1 = 0;
PC2 = 0;
ErrorCode = ErrorCode +1;
elseif RT1 < MinRT1
textmessage = 'Too FAST! Do not respond before the color is presented.';
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC1 = 0;
PC2 = 0;
ErrorCode = ErrorCode +1;
end
%Here is the script for S2
if RespKey2 == -1
textmessage = 'Please press the homekey!';
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
elseif RespKey2 == OneTrtyInfo.R2 & RT2 < MaxRT2 & RT2 > MinRT2
textmessage = 'Correct';
disp(textmessage)
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC2 = 1;
ErrorCode = 0;
elseif RespKey2 ~= OneTrtyInfo.R2
textmessage =['Error: The correct response was ' R2 ];
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC2 = 0;
ErrorCode = ErrorCode +1;
elseif RT2 > MaxRT2
textmessage = 'Your response was too slow! Please respond faster.';
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC2 = 0;
ErrorCode = ErrorCode +1;
elseif RT2 < MinRT2
textmessage = 'Too FAST! Do not respond before the color is presented.';
Screen('FillRect', ScreenInfo.MyHandle, ScreenInfo.black);
DrawFormattedText(ScreenInfo.MyHandle,textmessage, 'center', 'center', ScreenInfo.white);
Screen('Flip', ScreenInfo.MyHandle);
PC2 = 0;
ErrorCode = ErrorCode +1;
end

답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by