How can I generate a randomized vector of repeating numbers with given conditions?
2 views (last 30 days)
I'm trying to generate a vector of pseudo-random numbers that contains 1:11 repeated 8 times. The vector is broken up into blocks of 8. No number within each block can be repeated and each number has to occur at each position within the block once (i.e the number 4 has to occur first-eighth in eight different blocks). I've gone through a ton of iterations to do this and have attached the most recent attempt. The problem here is that by the end of the loop, the only possible numbers remaining are ones that have already been added within the current block of 8 numbers, so it becomes an endless while loop. Any help would be much appreciated!
TargTest=nan(8,11);%M by N array to indicate if Nth target was tested at Mth location
TestSessionTargs=; %Test Session Target order