function varargout = mink(varargin)
%MINK Find K smallest elements of codistributed array
%   Y = MINK(X,K)
%   Y = MINK(X,K,DIM)
%   Y = MINK(...,'ComparisonMethod',C)
%   [Y,I] = MINK(...)
%   
%   Example:
%   spmd
%       N = 1000;
%       D = codistributed(magic(N))
%       m = mink(D,10)
%       m1 = mink(D,10,1)
%       m2 = min(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 MINK, CODISTRIBUTED, MAGIC.
%   


%   Copyright 2018-2019 The MathWorks, Inc.

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

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