randomize trials but make sure they are equally shown
5 views (last 30 days)
Show older comments
Hi everyone,
I am writing Code for a metacognition Experiment. I would like to make sure that conditions are equally distributed within blocks of Trials (50% A, 50 B) but they are random at the same time. Shuffle just randomizes them and I have no idea how to do that. Thanks for your help.
0 Comments
Answers (1)
Walter Roberson
on 19 Sep 2017
Within each block, use randperm to choose an order.
For example:
A = 1:20;
B = A+100;
AB = [A,B];
rAB = AB(randperm(length(AB))); %repeat as needed
0 Comments
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!