23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2cplxpair<br />

Purpose Sort complex numbers into complex conjugate pairs<br />

Syntax B = cplxpair(A)<br />

B = cplxpair(A,tol)<br />

B = cplxpair(A,[],dim)<br />

B = cplxpair(A,tol,dim)<br />

cplxpair<br />

Description B = cplxpair(A) sorts the elements along different dimensions of a complex<br />

array, grouping together complex conjugate pairs.<br />

The conjugate pairs are ordered by increasing real part. Within a pair, the<br />

element with negative imaginary part comes first. The purely real values are<br />

returned following all the complex pairs. The complex conjugate pairs are<br />

forced to be exact complex conjugates. A default tolerance of 100*eps relative<br />

to abs(A(i)) determines which numbers are real and which elements are<br />

paired complex conjugates.<br />

If A is a vector, cplxpair(A) returns A with complex conjugate pairs grouped<br />

together.<br />

If A is a matrix, cplxpair(A) returns A with its columns sorted and complex<br />

conjugates paired.<br />

If A is a multidimensional array, cplxpair(A) treats the values along the first<br />

non-singleton dimension as vectors, returning an array of sorted elements.<br />

B = cplxpair(A,tol) overrides the default tolerance.<br />

B = cplxpair(A,[],dim) sorts A along the dimension specified by scalar dim.<br />

B = cplxpair(A,tol,dim) sorts A along the specified dimension and overrides<br />

the default tolerance.<br />

Diagnostics If there are an odd number of complex numbers, or if the complex numbers<br />

cannot be grouped into complex conjugate pairs within the tolerance, cplxpair<br />

generates the error message<br />

Complex numbers can't be paired.<br />

2-345

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!