- Color
- FaceColor
STROOP TEST- COGENT
8 次查看(过去 30 天)
显示 更早的评论
Hi,
a) how do create a stroop test to randomise the colour of the word. e.g. the word 'RED' with a blue/green/white font colour
b) i am also interested in randomising the colour of a square
i have the codes to display the word and the 2 squares below it but how do i get it to run with varying colours throughout the experiment in a randomised order?
any help would be much appreciated and many thanks in advance
0 个评论
采纳的回答
Adam Danz
2019-12-6
编辑:Adam Danz
2019-12-6
The handle to the text object and the handle to the "square" (not sure what you mean here, it could be a rectangle object, a patch object, an axes, who knows...) both have properties that allow you to edit their colors. But the property names vary between different sets of objects. Since we don't know what kind of objects you're working with, we can only be as specific as the content offered in your question (which isn't specific).
The two most common property names that changes an object's color are
This demo below shows you how to change the "Color" property. The "FaceColor" property of other objects works in the same way.
h = text(. . .);
h.Color = 'r';
% -or-
h.Color = [1 0 0];
% -or-
set(h, 'Color', [1 0 0])
9 个评论
Adam Danz
2019-12-9
Here's a general template to show how to set up a loop. I don't know what loop you want to make but you can follow this plan:
for i = 1:size(conditions ,1)
% access the i_th condition
condition.colorWord(i)
condition.Color(i)
end
About the content on the cogent website, there are comments on each line of the code that tells you what the lines are doing. If you have a question about a specific line and cannot understand the help() and doc() literature, tell me which line to help you out with.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!