Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Feedback for the second stimulus does not show up

2 vues (au cours des 30 derniers jours)
xxxx1017
xxxx1017 le 18 Mar 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by