MATLAB: The integer data sructures such as int8 or int16 has NaN values

dataintegernannumber

The integer data sructures such as int8 or int16 has NaN values?

Best Answer

No. Integer variables such as int8 or int16 do not allow NaN as an element. A simple test answers the question.
u = int8([0,10,NaN])
u =
0 10 0
u = int16([0,10,NaN])
u =
0 10 0
If you think about how the variables are stored in Binary form, NaN (or inf) would be impossible to encode in that form, without limiting the dynamic range of the variable.
Related Question