function D = sprandn( varargin )
%DISTRIBUTED.SPRANDN Sparse normally distributed random distributed matrix
%   
%   D = DISTRIBUTED.SPRANDN(S) has the same sparsity structure as S, but normally
%   distributed random entries. 
%   
%   D = DISTRIBUTED.SPRANDN(M,N,DENSITY) is a random M-by-N sparse
%   distributed matrix with approximately DENSITY*M*N normally
%   distributed nonzero entries. 
%   
%   Example:
%       N = 1000;
%       D = distributed.sprandn(N, N, 0.01);
%   
%   See also SPRANDN, DISTRIBUTED.
%   
%   


%   Copyright 2008-2020 The MathWorks, Inc.

% static method of distributed

% If only one input, treat as instance form, otherwise use static builder.
if nargin==1
    A = varargin{1};
    if ~isa(A,'distributed')
        A = distributed(A);
    end
    D = distributedutil.distributedSpmdWrapper( @sprandn, A );
else
    D = distributed.sBuild( @codistributed.sprandn, 'sprandn', varargin{:} );
end

end
