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!