Generating random number from a vector

2 vues (au cours des 30 derniers jours)
Aftab Ahmed Khan
Aftab Ahmed Khan le 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.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by