필터 지우기
필터 지우기

how select random n element af array without replacement

조회 수: 2 (최근 30일)
zohre saeedi
zohre saeedi 2016년 10월 9일
답변: Walter Roberson 2016년 10월 9일
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