x = cplxpair(x)x = cplxpair(x,tol)
x = cplxpair(x) returns x with complex conjugate pairs grouped together. The conjugate pairs are ordered by increasing real part. Within a pair, the element with negative imaginary part comes first. The purely real values are returned following all the complex pairs.
The complex conjugate pairs are forced to be exact complex conjugates. A default tolerance of 100*eps relative to abs(x(i)) determines which numbers are real and which elements are paired complex conjugates.
x = cplxpair(x,tol) overrides the default tolerance.
cplxpair(exp(2*pi*i*(0:4)/5)')ans =-0.8090 - 0.5878i-0.8090 + 0.5878i0.3090 - 0.9511i0.3090 + 0.9511i1.0000
cplxpair generates the error message:
Complex numbers can't be paired.
(c) Copyright 1994 by The MathWorks, Inc.