function fmt = dims(obj)
%DIMS   Data format of a dlarray
%   D = DIMS(X) returns the data format of X. D is a char array where each
%   letter represents a label on one of the dimensions of X. If X is
%   unformatted, D is empty. Otherwise, the length of D is equal to
%   NDIMS(X).
%
%   See also DLARRAY, FINDDIM, STRIPDIMS, NDIMS

%   Copyright 2019 The MathWorks, Inc.

fmt = obj.FormattedData.DimensionMetadata;
if ~isempty(obj.ViewToDataMap) && ~isempty(fmt)
    fmt = fmt(obj.ViewToDataMap);
end
end

