The positioning of 0's and 1's across the matrix should be random. At the same time, the number of 1's should be fixed. Something like this {1 0 1 0 1 0; 0 1 0 1 0 0; 1 0 1 0 1 0; 0 1 0 1 0 1; 0 0 0 0 0 1 0 0 0 0 0 0} I tried using randperm randi .but I am not getting equal number of 1's Thanks in advance
MATLAB: How to generate a RANDOM matrix of 0’s and 1’s such that the number of 1’s in any column is the same.
random number generator
Best Answer