NaN
Create array of allNaN
值
Syntax
Description
x = nan
返回“非数字”的标量表示。运营返回NaN
when they have undefined numeric results, such as0/0
或者0*Inf
。
x = nan(
返回SZ1,...,SZN
)sz1
-经过-。..-by-szN
大批ofNaN
值, whereSZ1,...,SZN
indicate the size of each dimension. For example,南(3,4)
returns a 3-by-4 matrix.
Examples
Input Arguments
提示
x = nan
returns the scalar, typedouble
, IEEE®representation of "not a number". The exact bit-wise hexadecimal representation of this value isfff8000000000000
。MATLAB®保留替代的“非数字”状态NaN
representations and treats all representations equivalently. In some special cases, due to hardware limitations for example, MATLAB does not preserve the exact bit pattern of the alternate representations during computation, and instead uses the canonicalNaN
先前描述的位模式。NaN
值are not equal to each other. As a result, comparison operations involvingNaN
return false, except for the not equal operator〜=
。For example,NaN == NaN
返回逻辑0(false
) butnan〜 = nan
返回逻辑1(真的
).NaN
值in a vector are treated as different unique elements. For example,unique([1 1 NaN NaN])
returns the row vector[1 NaN NaN]
。Use the
isnan
或者ismissing
检测功能NaN
数组中的值。这rmmissing
功能检测和删除NaN
值, and thefillmissing
功能检测NaN
价值并用非 - 取代它们NaN
值。