Generate 50000 binary sequence of 16 bits long (without repetition) without using "rand(1,16) > 0.5" logic
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sagar Dutta
am 8 Sep. 2019
Kommentiert: Sagar Dutta
am 8 Sep. 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 Kommentare
Akzeptierte Antwort
Bruno Luong
am 8 Sep. 2019
Bearbeitet: Bruno Luong
am 8 Sep. 2019
c=dec2bin(randperm(2^16,50000)-1,16)
a=c-'0' % if you need binary arrays
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!