Generate 50000 binary sequence of 16 bits long (without repetition) without using "rand(1,16) > 0.5" logic
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sagar Dutta
el 8 de Sept. de 2019
Comentada: Sagar Dutta
el 8 de Sept. de 2019
Can anyone give me some idea on how can I generate 16 digit binary sequence (without repeating any sequence) 50000 times without using "rand(1,16) > 0.5" logic "rand(1,16) > 0.5" logic. For some reason I think that "rand(1,16) > 0.5" logic will give me repetition of the binary sequence.
0 comentarios
Respuesta aceptada
Bruno Luong
el 8 de Sept. de 2019
Editada: Bruno Luong
el 8 de Sept. de 2019
c=dec2bin(randperm(2^16,50000)-1,16)
a=c-'0' % if you need binary arrays
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!