Effacer les filtres
Effacer les filtres

Finding the first 1 in indicator variable

1 vue (au cours des 30 derniers jours)
Mads
Mads le 25 Mai 2011
Hi all.
If i have an indicator variable which a bunch of 1's. How do i most efficiently find the position of the first 1?
Thx

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 25 Mai 2011
out = find(A,1,'first')
A - your indicator variable (vector)
[outI,outJ] = find(A,1,'first')
here A - your indicator variable (matrix)

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by