Filter löschen
Filter löschen

Generating random number from a vector

10 Ansichten (letzte 30 Tage)
Aftab Ahmed Khan
Aftab Ahmed Khan am 10 Jan. 2015
Kommentiert: Aftab Ahmed Khan am 10 Jan. 2015
Hello everyone, If i have a vector like A = [1 2 3 4 5 6.......30] and i want to pick a random value from this vector A. How can i do that. Thank you so much.

Akzeptierte Antwort

Guillaume
Guillaume am 10 Jan. 2015
A(randi(numel(A))
  1 Kommentar
Aftab Ahmed Khan
Aftab Ahmed Khan am 10 Jan. 2015
Thank you, it worked the way i wanted it to. take care.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

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