What is the difference between rand and randi when using it in a 3D array
이전 댓글 표시
What is the difference between rand and randi when using it in a 3D array
채택된 답변
추가 답변 (1개)
madhan ravi
2018년 8월 25일
Maybe try this:
array(randi([1 length(array)],1))
댓글 수: 8
madhan ravi
2018년 8월 25일
편집: madhan ravi
2018년 8월 25일
Doesn’t it work? You changed the question?
Shivam
2018년 8월 25일
madhan ravi
2018년 8월 25일
randi produces random integer numbers and rand produces random floating numbers
madhan ravi
2018년 8월 25일
randi was used here because the index of an array should be an integer.
madhan ravi
2018년 8월 25일
Was my answer different?
Shivam
2018년 8월 25일
madhan ravi
2018년 8월 25일
Give a vote for my answer if you find it useful :)
Foad Brakhasi
2023년 1월 18일
Thanks it was useful.
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!