Clear Filters
Clear Filters

Finding the first 1 in indicator variable

2 views (last 30 days)
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

Accepted Answer

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

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!