Hi guys, I am trying to make a 1024 by 1024 zeros matrix with specifically 20 ones randomly placed anywhere within the zeros matrix. I feel like it's easy but can anyone help?
MATLAB: Select specific number of random ones placed in a zeros matrix
binarymatrixmatrix manipulationoneszeros
Related Question
- How to generate a matrix with exact number of ones(with respect to random distribution)
- How to shuffle a 16*147 matrix
- How to generate 0 and 1 with equal probability using ‘randi’ function
- I want to create a nxn matrix with all 0s and n randomly placed 1s
- How to randomly place ones in specified postions of a matrix
- How to generate a random matrix with 0’s and 1’s
- For the same answer,,suppose, X ranges from 1 to 500, y ranges from 1 to 200 , Is it possible to find how many such coordinates are possible so that distance from each and every coordinate to other coordinate is > 20
Best Answer