how select random n element af array without replacement

10 Ansichten (letzte 30 Tage)
zohre saeedi
zohre saeedi am 9 Okt. 2016
Beantwortet: Walter Roberson am 9 Okt. 2016
I have array with m members. how I can select 10 member of it randomly and without replacement?

Akzeptierte Antwort

KSSV
KSSV am 9 Okt. 2016
Bearbeitet: KSSV am 9 Okt. 2016
Let a be your array..to select 10 memebers randomly out of a use
iwant = randsample(a,10)

Weitere Antworten (2)

Walter Roberson
Walter Roberson am 9 Okt. 2016
samples = YourArray(randperm(m, 10)); %without replacement

zohre saeedi
zohre saeedi am 9 Okt. 2016
thanks for your help

Community Treasure Hunt

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

Start Hunting!

Translated by