Effacer les filtres
Effacer les filtres

how select random n element af array without replacement

2 vues (au cours des 30 derniers jours)
zohre saeedi
zohre saeedi le 9 Oct 2016
I have array with m members. how I can select 10 member of it randomly and without replacement?

Réponse acceptée

KSSV
KSSV le 9 Oct 2016
Modifié(e) : KSSV le 9 Oct 2016
Let a be your array..to select 10 memebers randomly out of a use
iwant = randsample(a,10)

Plus de réponses (2)

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

zohre saeedi
zohre saeedi le 9 Oct 2016
thanks for your help

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by