Scilab 6.0.1
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
isreal
check if a variable is stored as a complex matrix
Syntax
t = isreal(x) t = isreal(x, eps)
Arguments
- x
Matrices of real or complex numbers (full or sparse storage). Matrices of polynomials or rationals, with real or complex coefficients.
- eps
a positive or null real (default value = 0)
- t
a boolean
Description
isreal(x)
returns %T (true) if x
is
stored as a real variable, and %F (false) x
is stored with
an (eventually zero) imaginary part.
isreal(x, eps)
returns %T (true) if
x
is stored as a real variable, or if the maximal absolute
value of imaginary parts of its components is less or equal than eps
.
Examples
isreal([]) // => %T isreal([1 2]) isreal(1+0*%i) isreal(1+0*%i,0) // Sparse matrix: isreal(sparse([1-%i -3+4*%i])) // Polynomial: p = (1-2*%s)^2 isreal(p) // Rational fraction: r = [ (%i-%s)/%s^2 %s/(2-%s)] isreal(r)
History
Version | Description |
6.0 | Extension to rationals |
Report an issue | ||
<< imult | Complex | real >> |