isinf
Determine which array elements are infinite
Syntax
Description
returns a
logical array containing TF
= isinf(A
)1
(true
) where the elements
of the array A
are Inf
or -Inf
, and
0
(false
) where they are not. If
A
contains complex numbers, isinf(A)
contains
1
for elements with infinite real or imaginary part, and
0
for elements where both real and imaginary parts are finite or
NaN
.
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.
Extended Capabilities
Version History
Introduced before R2006a