Generate random integer
이전 댓글 표시
Hi,
Can anyone help me to generate several strings of random integer ? In each string, there must be 5 integers generated which the number are in between 1 and 484. let say i wanna have 5 strings of the number. below is the example of the matrix that i need.
random number = [ 4 56 32 75 103; 47 84 302 400 27; 96 187 255 33 14; 387 293 135 34 73; 165 243 93 142 65 ]
Thanks in advanced.
nurul
채택된 답변
추가 답변 (1개)
Sahan
2013년 3월 19일
you can use randint function
test = randint(5,5,[1 484])
댓글 수: 1
Walter Roberson
2013년 3월 19일
Note that randint() is part of the Communications Toolbox, and will be removed in the future; randi() is the recommended replacement.
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!