how to generate a random digital sequence formed of only two bits
2 次查看(过去 30 天)
显示 更早的评论
fo example how to generate 00 or 01 0r 10 or 11 randomly?
0 个评论
采纳的回答
Azzi Abdelmalek
2013-1-12
randi(2,2,1)'-1
4 个评论
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!