function D = NaN( varargin )
%DISTRIBUTED.NAN Build distributed array containing Not-a-Number
%   D = DISTRIBUTED.NAN(N) is an N-by-N distributed matrix of NANs.
%   
%   D = DISTRIBUTED.NAN(M,N) is an M-by-N distributed matrix of NANs.
%   
%   D = DISTRIBUTED.NAN(M,N,K,...) or DISTRIBUTED.NAN([M,N,K,...])
%   is an M-by-N-by-K-by-... distributed array of NANs.
%   
%   D = DISTRIBUTED.NAN(M,N,K,..., CLASSNAME) or 
%   DISTRIBUTED.NAN([M,N,K,...], CLASSNAME) is an M-by-N-by-K-by-... 
%   distributed array of NANs of class specified by CLASSNAME.  CLASSNAME
%   must be either 'single' or 'double'.
%   
%   D = NAN(...,'like',P) for a DISTRIBUTED argument P returns a distributed array of NANs of the 
%   same complexity as P. If CLASSNAME is not specified then D has the same underlying class
%   as P. P must have underlying class 'single' or 'double'.
%   
%   As shown in the example, all forms of the built-in function have been 
%   overloaded for distributed arrays.
%   
%   Example:
%       N = 1000;
%       % Create a 1000-by-1 distributed array of underlying class 'single'
%       % containing the value NaN.
%       D1 = distributed.NAN(N, 1,'single');
%       % D2 is a 1000-by-1000 distributed array with the same underlying class
%       D2 = NAN(N,'like',D1); 
%       D3 = distributed.NAN(1, N);
%   
%   See also NAN, DISTRIBUTED, DISTRIBUTED/ZEROS, DISTRIBUTED/ONES.


%   Copyright 2008-2020 The MathWorks, Inc.

% static method of distributed

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