how select random n element af array without replacement

2 次查看(过去 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

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by