how select random n element af array without replacement

6 次查看(过去 30 天)
I have array with m members. how I can select 10 member of it randomly and without replacement?

采纳的回答

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

更多回答(2 个)

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

zohre saeedi
zohre saeedi 2016-10-9
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