I have a file having a sample size of 491520. I want to save every alternative 102 samples separately. For example - I want 1 to 102 but don't want 103 to 204 and so on.

 채택된 답변

Akira Agata
Akira Agata 2018년 5월 10일

1 개 추천

Like this?
% Sample data (size of 491520)
data = rand(491520,1);
idx = repelem([true;false],102);
idx = repmat(idx,ceil(491520/204),1);
idx = idx(1:size(data,1)); % Since 491520 can't be divided by 204
% Separate every alternative 102 samples
data1 = data(idx);
data2 = data(~idx);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

태그

질문:

2018년 5월 10일

댓글:

2018년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by