function b = setcats(a, varargin)
%SETCATS Set the categories of a categorical array.
%   
%   B = SETCATS(A,NEWCATEGORIES)
%    
%   See also CATEGORICAL/SETCATS, codistributed.
%   


%   Copyright 2016-2020 The MathWorks, Inc.

narginchk(2,2);
if nargout == 0
    error(message('MATLAB:categorical:NoLHS',upper(mfilename),',NEWCATEGORIES'));
end

% Simply apply to all elements (trailing args will be broadcast)
b = codistributed.pElementwiseUnaryOpWithCatch(@setcats, a, varargin{:});
end
