max

Maximum value function.

Syntax

max(expr)

Argument

expr
A valid scalar, vector, or matrix expression.

Example

Templex Expression Results
{max(17)} 17
{max( {3, 3, 7} )} 7
{max({{1, -2}, {3, 1}})} 3

Comments

The max function returns the maximum value of expr. The result is a scalar.

If expr is a scalar, the result is expr.

If expr is either a vector or a matrix, the result is the element with the greatest value.