MinI
MinI
MinI[ list ] returns the index of the smallest value in a list.
Usages
MinI[ list ]
MinI[ list ] returns the position (starting at 1) of the element of list with the smallest numerical value.
| Example | in | out |
|---|---|---|
The smallest value is at position 3. |
MinI[ {3, 2, 1} ] |
3 |
Sqrt[3] is the smallest value. |
MinI[ {Sqrt[3], Sqrt[5], Sqrt[7]} ] |
1 |
| Negative numbers. | MinI[ {-3, -1, -2} ] |
1 |
Details
- Equal values: if the smallest value occurs more than once, the first position is returned:
MinI[ {2, 5, 2} ]returns1. - Elements without a numerical value: if any element has no numerical value (such as
x),MinIis left unevaluated:MinI[ {2, x} ]staysMinI[ {2, x} ].
| Invalid input | Result |
|---|---|
MinI[ {} ] |
0, which is not a valid position. |
MinI[ 5 ] |
5: an argument that is not a list is returned unchanged. |
MinI[ 3, 5 ] |
Error: the number of arguments should be 1 |