isnan
Determine which array elements are NaN
Syntax
Description
returns a
logical array containing TF = isnan(A)1 (true) where the elements
of A are NaN, and 0
(false) where they are not. If A contains complex
numbers, isnan(A) contains 1 for elements with either
real or imaginary part is NaN, and 0 for elements
where both real and imaginary parts are not NaN.
Examples
Input Arguments
Tips
If
xis a real scalar, exactly one ofisfinite(x),isinf(x), andisnan(x)returns logical1(true).For a complex scalar
z,isinf(z)andisnan(z)can both return logical 1. For example,isinf(complex(Inf,NaN))andisnan(complex(Inf,NaN))both return logical 1.
Extended Capabilities
Version History
Introduced before R2006a