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

9 vues (au cours des 30 derniers jours)
What is the difference between rand and randi when using it in a 3D array

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 25 Août 2018
Modifié(e) : KALYAN ACHARJYA le 25 Août 2018
Its similar as usual, rand for uniformly distributed random number including floatings numbers, whereas randi for integers.

Plus de réponses (1)

madhan ravi
madhan ravi le 25 Août 2018
Maybe try this:
array(randi([1 length(array)],1))
  8 commentaires
madhan ravi
madhan ravi le 25 Août 2018
Give a vote for my answer if you find it useful :)
Foad Brakhasi
Foad Brakhasi le 18 Jan 2023
Thanks it was useful.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by