indexofmin

Index of vector minimum value function.

Syntax

indexofmin(vec_expr)

Argument

vec_expr
A valid vector expression.

Example

Templex Expression Result
{indexofmin( {1, -2, 3, 2, 1} )} 1
{indexofmin( {3, 3, 3} )} 0

Comments

The indexofmin function returns the index of the minimum value of a vector. vec_expr must be a vector. The result is a scalar. The first index of a vector is zero.

If the minimum value occurs more than once in a vector, the index of the first occurrence is given.