Contents Previous Next Subchapters

Determining The Maximum Element In Each Column
Syntax colmax(x)
colmax(
xindex)
See Also colrange , maxs , mins , rowmax , colnorm , colmean

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

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

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