cplxreal
Function to divide vector z into complex and real elements, removing the one of each complex conjugate pair.
Calling Sequence
[zc, zr] = cplxreal (z, thresh)
[zc, zr] = cplxreal (z)
zc = cplxreal (z, thresh)
zc = cplxreal (z)
Parameters
z:
vector of complex numbers.
thresh:
tolerance for comparisons.
zc:
vector containing the elements of z that have positive imaginary parts.
zr:
vector containing the elements of z that are real.
Description
This is an Octave function.
Every complex element of z is expected to have a complex-conjugate elsewhere in z. From the pair of complex-conjugates, the one with the negative imaginary part is removed.
If the magnitude of the imaginary part of an element is less than the thresh, it is declared as real.
Examples