Effacer les filtres
Effacer les filtres

Find consecutive ones and save the contents

1 vue (au cours des 30 derniers jours)
Nina Perf
Nina Perf le 17 Mar 2022
Modifié(e) : Nina Perf le 17 Mar 2022
Hi,
indcol1 = ind(:,1); % the indexes
indcol2 = ind(:,2); % the array of 1 and 0
Thank you in advance!

Réponse acceptée

David Hill
David Hill le 17 Mar 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

Plus de réponses (1)

Matt J
Matt J le 17 Mar 2022
Modifié(e) : Matt J le 17 Mar 2022

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by