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

7 views (last 30 days)
What is the difference between rand and randi when using it in a 3D array

Accepted Answer

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

More Answers (1)

madhan ravi
madhan ravi on 25 Aug 2018
Maybe try this:
array(randi([1 length(array)],1))
  8 Comments

Sign in to comment.

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!