Finding the first 1 in indicator variable
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 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)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!