Create array of allNaN
价值
x = nan
返回“不是数字”的标量表示。运营返回NaN
when they have undefined numeric results, such as0/0
要么0*Inf
。
x = nan(
返回A.sz1,...,szn
)sz1
-通过-。..-by-szN
阵列ofNaN
价值, wheresz1,...,szn
indicate the size of each dimension. For example,南(3,4)
returns a 3-by-4 matrix.
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 theisnan
要么ismissing
可以检测NaN
数组中的值。该rmmissing.
功能检测和删除NaN
价值, and thefillmissing
功能检测NaN
价值and replaces them with non-NaN
价值。