function out = categorical(varargin)
%CATEGORICAL    Create a categorical array.
%   C = CATEGORICAL(DATA)
%   C = CATEGORICAL(DATA,VALUESET)
%   C = CATEGORICAL(DATA,VALUESET,CATEGORYNAMES)
%   C = CATEGORICAL(DATA, ..., 'Ordinal',ORD)
%   C = CATEGORICAL(DATA, ..., 'Protected',PROTECT)
%
%   The arguments DATA and VALUESET can be dlarray objects.
%   
%   If the dlarray object has dimension labels, these are ignored when
%   converting to a categorical array.
%
%   Example:
%   c = categorical(dlarray(randi([1 3], 5, 2)), dlarray(1:3),...
%       {'red','green','blue'})
%
%   See also DLARRAY, CATEGORICAL.
%
%   Copyright 2022 The MathWorks, Inc.

varargin = extractDlarrayCell(varargin);
out = categorical(varargin{:});      
end