URGENT - CAN YOU HELP??
2 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I need to assign colours to Kb names as I am creating a stroop task script with Psychtoolbox.
This is a part of my script:
WordList = {'blanket', 'garage', 'shampoo', 'handle', 'sofa', 'curtain', 'switch', 'bathroom', 'vase', 'hallway', 'duster', 'lounge'};
rgbColors = [1 0 0; 0 1 0; 0 0 1];
rng('shuffle')
%Improve portability of the code acorss operating systems
KbName('UnifyKeyNames');
% Specify key names of interest
activeKeys = [KbName('LeftArrow') KbName('RightArrow') KbName('UpArrow') KbName('Space')];
% Restrict the keys for keyboard input to the keys we want
RestrictKeysForKbCheck(activeKeys);
% Suppress echo to the command line for keypresses
ListenChar(2);
%Assign Kb to colours ??????????
How can i pair the Kb with colours? For example, if it appear a word in yellow the participant has to press Kb 'Uparrow' and so forth.
回答 (1 件)
Walter Roberson
2020 年 10 月 28 日
編集済み: Walter Roberson
2020 年 10 月 28 日
You appear to be using the third party toolbox http://psychtoolbox.org/docs/RestrictKeysForKbCheck .
The code you show here does not display any text.
The code to display text in colour is specific to the toolbox, not part of MATLAB.
You would be responsible for keeping track of which color you assign with particular text, and for waiting for key presses and doing whatever is appropriate in your code when the "right" or "wrong" key press is found.
Really you are asking about Psychtoolbox, not about MATLAB. Psychtoolbox has its own forum, http://psychtoolbox.org/forum.html
I would suggest to you that in the future when you are working with a third-party toolbox, that you familiarize yourself with the resources / support facilities for the toolbox before you reach an "urgent" deadline.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!