function D = ones( varargin )
%DISTRIBUTED.ONES Ones distributed array
%   D = DISTRIBUTED.ONES(N) is an N-by-N distributed matrix of ones.
%   
%   D = DISTRIBUTED.ONES(M,N) is an M-by-N distributed matrix of ones.
%   
%   D = DISTRIBUTED.ONES(M,N,K,...) or DISTRIBUTED.ONES([M,N,K,...])
%   is an M-by-N-by-K-by-... distributed array of ones.
%   
%   D = DISTRIBUTED.ONES(M,N,K,..., CLASSNAME) or 
%   DISTRIBUTED.ONES([M,N,K,...], CLASSNAME) is an M-by-N-by-K-by-... 
%   distributed array of ones of class specified by CLASSNAME.
%   
%   D = ONES(...,'like',P) for a DISTRIBUTED argument P returns a distributed array of ones of the same
%   complexity as P and the requested size. If CLASSNAME is not specified then D has the same
%   underlying class as P. P must be of numeric or logical underlying class.
%   
%   Examples:
%       N  = 1000;
%       D1 = distributed.ones(N);   % 1000-by-1000 distributed matrix of ones
%       D2 = distributed.ones(N,N*2); % 1000-by-2000
%       D3 = distributed.ones([N,N*2], 'int8'); % underlying class 'int8'
%       D4 = ones(N,'like',D3) % 1000-by-1000 distributed array with underlying class 'int8'
%   
%   See also ONES, DISTRIBUTED, DISTRIBUTED/ZEROS.


%   Copyright 2008-2020 The MathWorks, Inc.

% static method of distributed

D = distributed.sBuild( @codistributed.ones, 'ones', varargin{:} );
end
