Borrar filtros
Borrar filtros

i have a vector which contain 23 elements.i wanna choose 20 elements among this 23 elements randomly.how can i do this?

1 visualización (últimos 30 días)
i have a vector which contain 23 elements.i wanna choose 20 elements among this 23 elements randomly.how can i do this?

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 19 de Abr. de 2016
Editada: Azzi Abdelmalek el 19 de Abr. de 2016
A=randi(50,1,23)
out = A(randperm(23,20))
  3 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping 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