matlab - How to find all minimum elements in a vector -


in matlab, function min(), can 1 single minimum element of vector, if there can several equal minimum elements. wondering how indices of minimum elements in vector?

for example,

v=[1,1]; 

i indices 1 , 2, both of index smallest elements 1.

thanks , regards!

you can use find find min values:

find(v == min(v)) 

Comments

Popular posts from this blog

python - Why doesn't list have safe "get" method like dictionary? -

razor - Is this a bug in WebMatrix PageData? -

sql server - Stored procedure -