필터 지우기
필터 지우기

how to generate a random digital sequence formed of only two bits

조회 수: 3 (최근 30일)
fo example how to generate 00 or 01 0r 10 or 11 randomly?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 12일
randi(2,2,1)'-1
  댓글 수: 4
Azzi Abdelmalek
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
mary
mary 2013년 1월 12일
aha ok thanx indeed for your explination.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by