Filter löschen
Filter löschen

Finding the first 1 in indicator variable

2 Ansichten (letzte 30 Tage)
Mads
Mads am 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

Akzeptierte Antwort

Andrei Bobrov
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)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by