function disp(obj)
%DISP Display distributed array
%   
%   Example:
%       N = 1000;
%       D = distributed.ones(N);
%       disp(D);
%   
%   See also DISP, DISTRIBUTED, DISTRIBUTED/DISPLAY.
%   


%   Copyright 2008-2023 The MathWorks, Inc.

% Empties are not displayed by DISP, except tabular with VariableNames.
if ~isempty(obj) || iIsEmptyTabularWithVariableNames(obj)
    thisClassName = 'distributed';
    noName = '';
    dh = dispInternal(obj, thisClassName, noName);
    dh.doDisp();
end

end

function tf = iIsEmptyTabularWithVariableNames(obj)
% Return true if obj is an empty tabular with existing VariableNames.

tf = isempty(obj) && istabular(obj) && (size(obj, 2) > 0);
end
