What is the difference between rand and randi when using it in a 3D array

8 次查看(过去 30 天)
What is the difference between rand and randi when using it in a 3D array

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2018-8-25
编辑:KALYAN ACHARJYA 2018-8-25
Its similar as usual, rand for uniformly distributed random number including floatings numbers, whereas randi for integers.

更多回答(1 个)

madhan ravi
madhan ravi 2018-8-25
Maybe try this:
array(randi([1 length(array)],1))
  8 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by