What is the difference between rand and randi when using it in a 3D array
Ältere Kommentare anzeigen
What is the difference between rand and randi when using it in a 3D array
Akzeptierte Antwort
Weitere Antworten (1)
madhan ravi
am 25 Aug. 2018
Maybe try this:
array(randi([1 length(array)],1))
8 Kommentare
madhan ravi
am 25 Aug. 2018
Bearbeitet: madhan ravi
am 25 Aug. 2018
Doesn’t it work? You changed the question?
Shivam
am 25 Aug. 2018
madhan ravi
am 25 Aug. 2018
randi produces random integer numbers and rand produces random floating numbers
madhan ravi
am 25 Aug. 2018
randi was used here because the index of an array should be an integer.
madhan ravi
am 25 Aug. 2018
Was my answer different?
Shivam
am 25 Aug. 2018
madhan ravi
am 25 Aug. 2018
Give a vote for my answer if you find it useful :)
Foad Brakhasi
am 18 Jan. 2023
Thanks it was useful.
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!