How can I define a random sequence of 16384 whole numbers between 0 and 3 and each integer represents two bits?

 採用された回答

dpb
dpb 2020 年 4 月 12 日

0 投票

v=randi([0 3],16384,1,'int8'); % save as int8; ML doesn' have arbitrary length integers.
You can visualize what have with
histogram(v)
dec2bin(v(1:10),2)

1 件のコメント

Nouha Derradji
Nouha Derradji 2020 年 4 月 12 日
It's work thakx :DD

サインインしてコメントする。

その他の回答 (1 件)

Matt J
Matt J 2020 年 4 月 12 日

0 投票

randi([0,3],16384,1)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2020 年 4 月 12 日

コメント済み:

2020 年 4 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by