Determine whether input is integer array
returns logicalTF
= isinteger(A
)1
(true
) ifA
is an array of integer type. Otherwise, it returns logical0
(false
).
Integer types in MATLAB®包括:int8
,int16
,int32
,int64
,uint8
,uint16
,uint32
, anduint64
. For more information, seeInteger Classes.
For a floating-point number of asingle
要么double
type, you can check if it is also an integer by using the回合
function (within the floating-point relative accuracyeps
). If the rounded value of the number is equal to the original value before rounding, then the number is an integer. For example,2 ==圆(2)
returns logical1
(true
) since2
is an integer.