Y = finite(X)
Y = finite(X)
returns 1s where the elements of X
are finite and 0s where they are infinite or NaN
. X
can be a vector or a matrix.
For any x
, exactly one of the three quantities finite(x)
, isinf(x)
, and isnan(x)
is equal to one.
x = [-2 -1 0 1 2]
Then
andfinite(1./x) = [1 1 0 1 1]
isinf(1./x) = [0 0 1 0 0]
isnan(1./x) = [0 0 0 0 0]
finite(0./x) = [1 1 0 1 1]
isinf(0./x) = [0 0 0 0 0]
isnan(0./x) = [0 0 1 0 0]
all
,any
,find
,isempty
,isinf
,isnan
(c) Copyright 1994 by The MathWorks, Inc.