NaN
Creates an Not-a-Number
📝Syntax
NaN
nan
NaN(n)
NaN(n, m)
NaN(n, classname)
NaN(n, m, classname)
NaN(classname)
📥Input Arguments
Parameter Description
n a scalar integer: number of rows (and columns if m is omitted).
m a scalar integer: number of columns.
classname a string: 'double' (default) or 'single'.
📄Description

NaN returns the IEEE symbol NaN (Not a Number).

NaN(n) returns an n-by-n matrix filled with NaN; NaN(n, m) returns an n-by-m matrix. The optional classname argument must be 'double' (default) or 'single'.

NaN is the result of operations which do not produce a well defined numerical result.

Beware, you must never compare NaN with NaN, in this case, please use isnan.

💡Examples
NaN
3 + NaN
NaN != NaN
isnan(NaN)
🔗See Also
isnan
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub