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

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -