Documentation Center

  • Trials
  • Product Updates

isinf

Array elements that are infinite

Syntax

TF = isinf(A)

Description

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.

Examples

a = [-2  -1  0  1  2];

isinf(1./a)

ans =
     0     0     1     0     0

isinf(0./a)

ans =
     0     0     0     0     0

See Also

| |

Was this topic helpful?