MATLAB: What does this do

matrixprogramming

I can't figure out what this bit of code is doing:
[m,n]=find(min(a))
I know that it is not returning the indices of the minimum entries in the array 'a', but what is it doing?

Best Answer

[m,n]=min(a)
m is the minimum, n is the index of n m in a
You can try an example
a=[4 7 3 6 2 7 8]
[m,n]=min(a)
Now if you write
r=find(min(a))
you will find the result
r=1
because in our example min(a)=2, it contains just one elment, so there is one index=1