Contents Previous Next Subchapters

Determining The Maximum Element In Each Row
Syntax rowmax(x)
rowmax(
xindex)
See Also colrange , colmax , rownorm , rowsum

Description
Computes the maximum of each row of x, where x is an integer, real, or double-precision matrix with at least one column. The return value is a column vector with the same type and number of rows as x. The j-th element of the return value is the maximum of the elements in the j-th row of x.

If index is present, its input value has no effect. Its output value is an integer column vector with the same number of rows as x. The j-th element of the output value of index is the index of the column containing the maximum element of the j-th row of x.

Example
     x = [ {1, 2, 3}, {5, 3, 1}, {-2, -1, -3} ]
     rowmax(x)
returns
     {
     5
     3
     3
     }