%% Mode of Matrix Rows
% Define a 3-by-4 matrix.

A = [3 3 1 4; 0 0 1 1; 0 1 2 4]

%
% Find the most frequent value of each row.

M = mode(A,2)

% Copyright 2012 The MathWorks, Inc.