Generating random number from a vector

18 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Guillaume
Guillaume il 10 Gen 2015
A(randi(numel(A))

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by