random entry selection from a matrix

Respuestas (1)

Doug Hull
Doug Hull el 23 de Jul. de 2012

0 votos

v = [1:10]
vi = randi(numel(v));
choice = v(vi)

1 comentario

Doug, you missed your chance to say
choice = v(randperm(numel(v),1));

Iniciar sesión para comentar.

Categorías

Preguntada:

el 23 de Jul. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by