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

7 Ansichten (letzte 30 Tage)
What is the difference between rand and randi when using it in a 3D array

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 25 Aug. 2018
Bearbeitet: KALYAN ACHARJYA am 25 Aug. 2018
Its similar as usual, rand for uniformly distributed random number including floatings numbers, whereas randi for integers.

Weitere Antworten (1)

madhan ravi
madhan ravi am 25 Aug. 2018
Maybe try this:
array(randi([1 length(array)],1))
  8 Kommentare
madhan ravi
madhan ravi am 25 Aug. 2018
Give a vote for my answer if you find it useful :)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by