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

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

+1
source share
2 answers

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

+5
source

Use min()with two output arguments. The first return value will be the value, the second will be the index of this value.

+2
source

Source: https://habr.com/ru/post/1788833/


All Articles