How to randomly choose 5% of a matrix to be of value 1.
1 view (last 30 days)
Gideon Idumah on 21 Apr 2019
I have a 256 x 256 matrix which has value 1 inside a small square 20 x 20 around the center, and zero elsewhere. I need to randomly choose say 5% elsewhere to be 1 also. How do I go about this?