필터 지우기
필터 지우기

Find consecutive ones and save the contents

조회 수: 1 (최근 30일)
Nina Perf
Nina Perf 2022년 3월 17일
편집: Nina Perf 2022년 3월 17일
Hi,
indcol1 = ind(:,1); % the indexes
indcol2 = ind(:,2); % the array of 1 and 0
Thank you in advance!

채택된 답변

David Hill
David Hill 2022년 3월 17일
s=num2str(ind6(:,2)');
s=s(s~=' ');
[Start,End]=regexp(s,'[1]{2,}');
for k=1:length(Start)
c{k}=ind6(Start(k):End(k),1)';
end

추가 답변 (1개)

Matt J
Matt J 2022년 3월 17일
편집: Matt J 2022년 3월 17일

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by