function varargout = mode(varargin)
%MODE   Mode, or most frequent value in a sample.
%   M = MODE(X)
%   [M,F] = MODE(X)
%   [M,F,C] = MODE(X)
%   [...] = MODE(X,DIM)
%   
%   Example:
%    
%       % Random integers normally distributed around 0
%       y = fix(gpuArray.randn(10000,10));
%       % Shift the center to 1..10
%       y = bsxfun(@plus, y, 1:10);
%       % Mode for each column is now 1:10
%       m = mode(y)
%   
%   See also MODE, MEDIAN, GPUARRAY, GPUARRAY/MEAN.


%   Copyright 2014-2020 The MathWorks, Inc.

% try...catch prevents error being reported by internal
try
    [varargout{1:nargout}] = parallel.internal.flowthrough.mode(varargin{:});
catch ME
    throw(ME);
end
