Where is the zero?

3 ビュー (過去 30 日間)
IBM watson
IBM watson 2018 年 11 月 9 日
コメント済み: IBM watson 2018 年 11 月 9 日
How to find the location of a zero (or a different number) in a vector ?
like :
a=[ 1 3 5 6 34 4 0 1 3 4 50]
=>7

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 9 日
編集済み: madhan ravi 2018 年 11 月 9 日
a=[ 1 3 5 6 34 4 0 1 3 4 50]
index=find(a==0)
  4 件のコメント
Stephen23
Stephen23 2018 年 11 月 9 日
Note that often logical indexing is more efficient than using find.
IBM watson
IBM watson 2018 年 11 月 9 日
I will take a look. Thanks :)

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by