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!