Borrar filtros
Borrar filtros

how select random n element af array without replacement

2 visualizaciones (últimos 30 días)
zohre saeedi
zohre saeedi el 9 de Oct. de 2016
Respondida: Walter Roberson el 9 de Oct. de 2016
I have array with m members. how I can select 10 member of it randomly and without replacement?

Respuesta aceptada

KSSV
KSSV el 9 de Oct. de 2016
Editada: KSSV el 9 de Oct. de 2016
Let a be your array..to select 10 memebers randomly out of a use
iwant = randsample(a,10)

Más respuestas (2)

Walter Roberson
Walter Roberson el 9 de Oct. de 2016
samples = YourArray(randperm(m, 10)); %without replacement

zohre saeedi
zohre saeedi el 9 de Oct. de 2016
thanks for your help

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by