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 CenterFile Exchange 中查找有关 Simulink 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by