Contents Previous Next Subchapters

Computing The Mode of Each Column
Syntax colmode(x)
See Also colrange , colmedian , colmean , sort

Description
Returns a row vector containing the mode, (the most frequently occurring value), of each column of x, where x is an integer, real, or double-precision matrix. The return value has the same type and column dimension as x.

Example
     X = {[3., 3, 1, 4], ...
          [0, 0, 1, 1], ...
           [0, 1, 2, 4]}
     colmode(X)
returns
     [ 0 , 0 , 1 , 1 ]