Borrar filtros
Borrar filtros

Generating random number from a vector

10 visualizaciones (últimos 30 días)
Aftab Ahmed Khan
Aftab Ahmed Khan el 10 de En. de 2015
Comentada: Aftab Ahmed Khan el 10 de En. de 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.

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 Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by