randi 0 to 3 (2bits)
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nouha Derradji
am 12 Apr. 2020
Kommentiert: Nouha Derradji
am 12 Apr. 2020
How can I define a random sequence of 16384 whole numbers between 0 and 3 and each integer represents two bits?
0 Kommentare
Akzeptierte Antwort
dpb
am 12 Apr. 2020
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)
Weitere Antworten (1)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!