Filter löschen
Filter löschen

Find consecutive ones and save the contents

1 Ansicht (letzte 30 Tage)
Nina Perf
Nina Perf am 17 Mär. 2022
Bearbeitet: Nina Perf am 17 Mär. 2022
Hi,
indcol1 = ind(:,1); % the indexes
indcol2 = ind(:,2); % the array of 1 and 0
Thank you in advance!

Akzeptierte Antwort

David Hill
David Hill am 17 Mär. 2022
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

Weitere Antworten (1)

Matt J
Matt J am 17 Mär. 2022
Bearbeitet: Matt J am 17 Mär. 2022

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by