Find a block of ones in a vector
Afficher commentaires plus anciens
Hi,
I have a simple question but no matlab command for this :). I have a vector containing zeros and ones. I want to find every beginning of a block containing only of ones. For example: 000110011100. I want to get 4 and 8 as the indices indicating the beginning of a block with only ones.
Thank you for your efforts.
Réponse acceptée
Plus de réponses (1)
fcarl
le 12 Sep 2011
0 votes
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!