Contents Previous Next Subchapters Current Chapters-> prctile ftail tpdf ttail ittail cnormal inormal rand snormal seed colmad colmse colrange colmode kurtosis skewness randperm ranseed unifm0v1 unirnd normrnd exprnd gamrnd cauchyrnd gumbelrnd laplacernd lognrnd wblrnd binornd poissrnd exppdf expcdf normpdf unifpdf unifcdf wblpdf wblcdf colcor colcov colmean colstd colmax rowmax colsum rowsum colnorm rownorm median colmedian colmead colvar corr conv conv2 sum cumsum prod cumprod Parent Chapters-> Omatrix6 statistics colmax Search Tools-> contents reference index search

Determining The Maximum Element In Each Column
 Syntax `colmax(`x```) colmax(```x`, `index`)` 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 ] ```