how to generate a random digital sequence formed of only two bits
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
fo example how to generate 00 or 01 0r 10 or 11 randomly?
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 12 Jan. 2013
randi(2,2,1)'-1
4 Kommentare
Azzi Abdelmalek
am 12 Jan. 2013
Bearbeitet: Azzi Abdelmalek
am 12 Jan. 2013
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!