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 rowmax Search Tools-> contents reference index search

Determining The Maximum Element In Each Row
 Syntax `rowmax(`x```) rowmax(```x`, `index`)` 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      } ```