Hi everybody,
I'm struggling with the sequence of my trials. In one block I have to present 4 images 30 times (tot number of trials 120). I want to randomly shuffle my images vector without repeating images, given that each images is repeated
equally. Moreover I have a second condition that can be 1 or 0 and I need that each image has the same number of 0 and 1. More specifically, I would like to repeat the matrix
[1 2 3 4 1 2 3 4 ;1 1 1 1 0 0 0 0]times,
so that 1, 2, 3 and 4 would all repeat 30 times without being consecutive.Example :
cond_a = [1 2 3 4];
cond_b = [1 0];
ntrial = 15;
trial = CombVec(cond_a,cond_b)';
trial = repmat(trial,ntrial,1);
cond_b = [1 0];
ntrial = 15;
trial = CombVec(cond_a,cond_b)';
trial = repmat(trial,ntrial,1);
trial_shuffle=Shuffle(trial,2);
%Right pseudorandom
1 1
2 0
3 1
4 0
1 0
2 0
1 1
4 0
3 1
4 1
3 0
2 1
1 0
4 0
3 1
2 1
2 0
3 1
4 0
1 0
2 0
1 1
4 0
3 1
4 1
3 0
2 1
1 0
4 0
3 1
2 1
%wrong pseudorandom
1 1
2 0
3 1
4 0
1 0
2 0
1 1
4 0
4 1
4 1
3 0
2 1
1 0
3 0
3 1
2 1
2 0
3 1
4 0
1 0
2 0
1 1
4 0
4 1
4 1
3 0
2 1
1 0
3 0
3 1
2 1
Many thanks for any suggestions..
Alice
Alice