Finding the first 1 in indicator variable

2 ビュー (過去 30 日間)
Mads
Mads 2011 年 5 月 25 日
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)
  1 件のコメント
Mads
Mads 2011 年 5 月 25 日
Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by