Generating random number from a vector

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.

 Respuesta aceptada

Guillaume
Guillaume el 10 de En. de 2015
A(randi(numel(A))

1 comentario

Aftab Ahmed Khan
Aftab Ahmed Khan el 10 de En. de 2015
Thank you, it worked the way i wanted it to. take care.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 10 de En. de 2015

Comentada:

el 10 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by