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

2 Stimmen

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

Community Treasure Hunt

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

Start Hunting!

Translated by