Finding the first 1 in indicator variable

1 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by