function t = tail(A, varargin)
%TAIL Get last rows of distributed array.
%   
%   TAIL(X) displays the last eight rows of the distributed array X in
%   the command window without storing a value.
%   
%   TAIL(X,K) displays up to K rows from the end of the distributed array
%   X. If X contains fewer than K rows, then the entire array is
%   displayed.
%   
%   Y = TAIL(X) or Y = TAIL(X,K) returns the last eight rows, or up to K
%   rows, of the distributed array X.
%   
%   See also: TAIL, DISTRIBUTED/HEAD, DISTRIBUTED.
%   
%   


%   Copyright 2016-2022 The MathWorks, Inc.

tmp = distributedutil.distributedSpmdWrapper( @tail, A, varargin{:} );

% As of R2023a, tail is also available for numeric arrays. It follows the
% same startegy to display and not set ANS when no output is requested.
if nargout==0
    disp(tmp);
else
    t = tmp;
end

end
