how to generate a random digital sequence formed of only two bits
조회 수: 2 (최근 30일)
이전 댓글 표시
fo example how to generate 00 or 01 0r 10 or 11 randomly?
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 1월 12일
randi(2,2,1)'-1
댓글 수: 4
Azzi Abdelmalek
2013년 1월 12일
편집: Azzi Abdelmalek
2013년 1월 12일
randi(4,5,6) will generate a random matrix 5x6 with numbers from 1 to 4
In our case
randi(2,1,2) will generate array 1x2 with numbers from 1 to 2, to make it from 0 to 1
out=randi(2,1,2)-1
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!