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!