Borrar filtros
Borrar filtros

Find consecutive ones and save the contents

1 visualización (últimos 30 días)
Nina Perf
Nina Perf el 17 de Mzo. de 2022
Editada: Nina Perf el 17 de Mzo. de 2022
Hi,
indcol1 = ind(:,1); % the indexes
indcol2 = ind(:,2); % the array of 1 and 0
Thank you in advance!

Respuesta aceptada

David Hill
David Hill el 17 de Mzo. de 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

Más respuestas (1)

Matt J
Matt J el 17 de Mzo. de 2022
Editada: Matt J el 17 de Mzo. de 2022

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by