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개)

Matt J
Matt J 2020년 4월 12일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

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