function varargout = maxk(varargin)
%MAXK Find K largest elements of codistributed array
%   Y = MAXK(X,K)
%   Y = MAXK(X,K,DIM)
%   Y = MAXK(...,'ComparisonMethod',C)
%   [Y,I] = MAXK(...)
%   
%   Example:
%   spmd
%       N = 1000;
%       D = codistributed(magic(N))
%       m = maxk(D,10)
%       m1 = maxk(D,10,1)
%       m2 = max(D,10,2,'ComparisonMethod','real')
%   end
%   
%   m and m1 are a set of K codistributed row vectors, m2 is a set of K codistributed  
%   column vectors.
%   
%   See also MAXK, CODISTRIBUTED, MAGIC.
%   


%   Copyright 2018-2019 The MathWorks, Inc.

narginchk(2, inf);
nargoutchk(0, 2);

[varargout{1:nargout}] = minkMaxkOp(@maxk, varargin{:});
end
