I have a requirement for generating a given number N of vectors of a given size, each of which corresponds to a uniform distribution of 0s and 1s.
This is what I am doing at the moment, but I noticed that the distribution hit a maximum at half 1 s and 0, which is not suitable for what I am doing:
a = randint(1, sizeOfVector, [0 1]);
The function looks promising for what I need, but I cannot figure out how to output the binary vector this size. unifrnd
In this case, I can use the function unifrnd(and if so, how would you rate it!), Or maybe there is some other more convenient way to get such a set of vectors?
Any help appreciated!
Note 1 : just to be sure - this is what it actually says:
randomly select N vectors of a given size that are uniformly distributed over [0; 1]
Note 2 . I am creating initial configurations for Cellular Automata, so I can only have binary values ββ[0; 1].
source
share