how to find the line number of a point in a vector
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a vector i=[0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0].
What can I use to find in which line number starts and ends number 1 each time?
0 commentaires
Réponse acceptée
Plus de réponses (1)
Fangjun Jiang
le 4 Sep 2019
Modifié(e) : Fangjun Jiang
le 4 Sep 2019
a=diff(i)
find(a==1)
find(a==-1)
adjust by 1
0 commentaires
Voir également
Catégories
En savoir plus sur DMM dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!