フィルターのクリア

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.

採用された回答

Bruno Luong
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 ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by