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

Computing The Range of Data for Each Column
 Syntax [min, max]  = colrange(x) [min, max, minIdx, maxIdx]  = colrange(x) See Also colmax , maxs , mins , colsum , colstd , colmean , colmedian , colmad

Description
Returns a row vector min containing the minimum values in each column of x, and a row vector max containing the maximum values in each column of x. The argument x is an integer, real or double-precision matrix. The returned values min and max have the same type and column dimension as x.

If present, the returned values minIdx and maxIdx are integer row vectors that contain the column index values of the returned min and max vectors. The vectors minIdx and maxIdx have the same column dimension as x.

Example
x = [ {1, 2, 3}, {5, 3, 1}, {-2, -1, -3} ]
[vMin, vMax ] = colrange(x)
print vMin
print vMax
returns
[ 1 , 1 , -3 ]
[ 3 , 5 , -1 ]
If you continue the example by entering
[vMin, vMax, minIdx, maxIdx ] = colrange(x)
print minIdx
print maxIdx
O-Matrix will respond
[ 1 , 3 , 3 ]
[ 3 , 1 , 2 ]