tags:

views:

77

answers:

2

How do I get the index of the smallest element in an array in matlab?

+3  A: 

[C,I] = min(...) finds the indices of the minimum values of A, and returns them in output vector I. If there are several identical minimum values, the index of the first one found is returned.

aaa
+1  A: 

Use the min() function with 2 output arguments. The first returned value will be the value, the second will be the index of that value.

linuxuser27

related questions