URGENT - CAN YOU HELP??

1 vue (au cours des 30 derniers jours)
Barbara Fiorani
Barbara Fiorani le 28 Oct 2020
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.

Réponses (1)

Walter Roberson
Walter Roberson le 28 Oct 2020
Modifié(e) : Walter Roberson le 28 Oct 2020
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.

Catégories

En savoir plus sur Timing and presenting 2D and 3D stimuli dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by