Generate 50000 binary sequence of 16 bits long (without repetition) without using "rand(1,16) > 0.5" logic
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Bruno Luong
2019-9-8
编辑:Bruno Luong
2019-9-8
c=dec2bin(randperm(2^16,50000)-1,16)
a=c-'0' % if you need binary arrays
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!