MATLAB Function Reference |
Syntax
Description
NaN
returns the IEEE arithmetic representation for Not-a-Number (NaN
). These result from operations which have undefined numerical results.
NaN('double')
is the same as NaN
with no inputs.
NaN('single')
is the single precision representation of NaN
.
NaN(n)
is an n
-by-n
matrix of NaN
s.
NaN(m,n)
or NaN([m,n])
is an m
-by-n
matrix of NaN
s.
NaN(m,n,p,...)
or NaN([m,n,p,...])
is an m
-by-n
-by-p
-by-... array of NaN
s.
NaN(...,classname)
is an array of NaN
s of class specified by classname
. classname
must be either 'single'
or 'double'
.
Examples
NaN
, such as sqrt(NaN)
(+Inf)+(-Inf)
0*Inf
0/0
and Inf/Inf
rem(x,y)
where y
is zero or x
is infinity
Remarks
Because two NaN
s are not equal to each other, logical operations involving NaN
s always return false, except ~= (not equal). Consequently,
and the NaN
s in a vector are treated as different unique elements.
Use the isnan
function to detect NaN
s in an array.
See Also
Inf
, isnan
namelengthmax | nargchk |
© 1994-2005 The MathWorks, Inc.