Determine whether array uses complex storage
To check whether each element of an array A
is real, use A
== real(A)
.
isreal(complex(A))
always returns false
,
even when the imaginary part is all zeros.
~isreal(x)
detects arrays that
have an imaginary part, even if it is all zeros.