how select random n element af array without replacement

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 日

0 投票

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 日

1 投票

samples = YourArray(randperm(m, 10)); %without replacement
zohre saeedi
zohre saeedi 2016 年 10 月 9 日

0 投票

thanks for your help

質問済み:

2016 年 10 月 9 日

回答済み:

2016 年 10 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by