This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Array elements that are infinite


TF = isinf(A)


TF = isinf(A) returns an array the same size as A containing logical 1 (true) where the elements of A are +Inf or -Inf and logical 0 (false) where they are not. For a complex number z, isinf(z) returns 1 if either the real or imaginary part of z is infinite, and 0 if both the real and imaginary parts are finite or NaN.

For any real A, exactly one of the three quantities isfinite(A), isinf(A), and isnan(A) is equal to one.


collapse all

Determine the infinite elements of the row vector, A.

A = 1./[-2 -1 0 1 2]
A = 1×5

   -0.5000   -1.0000       Inf    1.0000    0.5000

TF = isinf(A)
TF = 1x5 logical array

   0   0   1   0   0

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

| |

Introduced before R2006a