isnan
Check whether symbolic array elements are NaN
s
Syntax
Description
Examples
Determine Which Elements of Symbolic Array Are NaN
s
Using isnan
, determine which elements of this
symbolic matrix are NaN
s:
isnan(sym([pi NaN Inf; 1 + i Inf + i NaN + i]))
ans = 2×3 logical array 0 1 0 0 0 1
Input Arguments
Tips
For any
A
, exactly one of the three quantitiesisfinite(A)
,isinf(A)
, orisnan(A)
is1
for each element.Symbolic expressions and functions containing
NaN
evaluate toNaN
. For example,sym(NaN + i)
returns symbolicNaN
.
Version History
Introduced in R2013b