isinf
Determine which array elements are infinite
Syntax
Description
returns a logical array containingTF
= isinf(A
)1
(true
) where the elements of the arrayA
areInf
or-Inf
, and0
(false
) where they are not. IfA
contains complex numbers,isinf(A)
contains1
for elements with infinite real or imaginary part, and0
for elements where both real and imaginary parts are finite orNaN
.
Examples
Input Arguments
Tips
If
x
is 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.