Function to divide vector z into complex and real elements, removing the one of each complex conjugate pair.
[zc, zr] = cplxreal (z, thresh) [zc, zr] = cplxreal (z) zc = cplxreal (z, thresh) zc = cplxreal (z)
vector of complex numbers.
tolerance for comparisons.
vector containing the elements of z that have positive imaginary parts.
vector containing the elements of z that are real.
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.