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

1 回表示 (過去 30 日間)
mary
mary 2013 年 1 月 12 日
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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Translated by