function D = randi( varargin )
%DISTRIBUTED.RANDI Create a distributed array of random integers
%   
%   D = DISTRIBUTED.RANDI(IMAX, N) returns an N-by-N distributed array containing
%   pseudorandom integer values drawn from the discrete uniform distribution on
%   1:IMAX.
%   
%   D = DISTRIBUTED.RANDI(IMAX,M,N) or D = DISTRIBUTED.RANDI(IMAX,[M,N]) returns an M-by-N
%   distributed array. D = DISTRIBUTED.RANDI(IMAX,M,N,P,...) or D =
%   DISTRIBUTED.RANDI(IMAX,[M,N,P,...])  returns an M-by-N-by-P-... distributed array.
%   
%   D = DISTRIBUTED.RANDI([IMIN, IMAX], ...) returns a distributed array containing integer
%   values drawn from the discrete uniform distribution on IMIN:IMAX.
%   
%   D = DISTRIBUTED.RANDI(..., CLASSNAME) returns a distributed array with underlying class
%   CLASSNAME.
%   
%   D = RANDI(...,'like',P) for a distributed argument P returns a 
%   distributed array of pseudorandom integer values with the same underlying 
%   class as P.
%   
%   Examples:
%       % Generate random integers from the uniform distribution on the set 1:10:
%       D1 = distributed.randi(10, 1, 100)
%       % Generate a distributed array containing random integers from -10:10 
%       % of underlying class 'int32':
%       D2 = distributed.randi([-10 10], 1, 100, 'int32')
%       D3 = randi([-10 10], 1, 100, 'like', D2); % underlying class 'int32'
%   
%   See also RANDI, DISTRIBUTED.


%   Copyright 2008-2020 The MathWorks, Inc.

% static method of distributed

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