Dear All,
I have a table with 200 rows and 2 columns.
Now, I want to select 40 rows with step of 5. row 1 , 5 ,10, 15 ... 200. I try ramsample but it is randoms.
Could any one help me ?
table = randi(200,200,2) % create a maxtrix 1000x2
index = randsample(1:length(table),20)
result = table(index,:)

 채택된 답변

KSSV
KSSV 2022년 6월 14일

0 개 추천

Let T be you table.
idx = 0:5:200 ;
idx(1) = 1 ;
iwant = T(idx,:) ;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 6월 14일

댓글:

2022년 6월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by