# cdf2rdf

Convert complex diagonal form to real block diagonal form

## Syntax

``[Vnew,Dnew] = cdf2rdf(V,D)``

## Description

example

````[Vnew,Dnew] = cdf2rdf(V,D)` transforms the outputs of `[V,D] = eig(X)` or ```[V,D] = eigs(X,___)``` for real matrices `X` from complex diagonal form to real diagonal form. This operation transforms how the eigenvalues of `X` are expressed in `D`, and transforms `V` such that `X*Vnew = Vnew*Dnew`. In complex diagonal form, `D` is a diagonal matrix with complex conjugate pairs of eigenvalues on the main diagonal: $\left[\begin{array}{cccccc}{\lambda }_{1}& & & & & \\ & a+bi& & & & \\ & & a-bi& & & \\ & & & c+di& & \\ & & & & c-di& \\ & & & & & \ddots \end{array}\right]$Some of the eigenvalues along the diagonal might be real, but complex conjugate eigenvalue pairs are assumed to be next to one another.In real diagonal form, `Dnew` has real eigenvalues on the diagonal, and complex eigenvalues are expressed as 2-by-2 real blocks along the main diagonal: $\left[\begin{array}{cccccc}{\lambda }_{1}& & & & & \\ & a& b& & & \\ & -b& a& & & \\ & & & c& d& \\ & & & -d& c& \\ & & & & & \ddots \end{array}\right]$ ```

## Examples

collapse all

Calculate the eigenvalues and eigenvectors of a real matrix, and then transform the complex conjugate eigenvalue pairs into real blocks.

Find the eigenvalues and eigenvectors of a real matrix.

```X = [1 1 1 1 1 0 4 5 1 1 0 -5 4 1 1 0 0 2 3 1 0 0 -3 -2 1]; [V,D] = eig(X)```
```V = 5×5 complex 1.0000 + 0.0000i -0.0179 - 0.1351i -0.0179 + 0.1351i 0.1593 - 0.4031i 0.1593 + 0.4031i 0.0000 + 0.0000i 0.0130 - 0.6214i 0.0130 + 0.6214i 0.0704 - 0.0267i 0.0704 + 0.0267i 0.0000 + 0.0000i 0.6363 + 0.0000i 0.6363 + 0.0000i -0.1261 + 0.1032i -0.1261 - 0.1032i 0.0000 + 0.0000i 0.1045 - 0.2087i 0.1045 + 0.2087i -0.2279 - 0.4161i -0.2279 + 0.4161i 0.0000 + 0.0000i -0.1156 + 0.3497i -0.1156 - 0.3497i 0.7449 + 0.0000i 0.7449 + 0.0000i ```
```D = 5×5 complex 1.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 3.8801 + 5.1046i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 3.8801 - 5.1046i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 2.1199 + 0.7018i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 2.1199 - 0.7018i ```

`D` contains one real eigenvalue and two pairs of complex conjugate eigenvalues.

Transform `V` and `D` so that `Dnew` is in real block diagonal form and `Vnew` satisfies `X*Vnew = Vnew*Dnew`

`[Vnew,Dnew] = cdf2rdf(V,D)`
```Vnew = 5×5 1.0000 -0.0253 -0.1911 0.2253 -0.5701 0 0.0184 -0.8789 0.0996 -0.0378 0 0.8999 0 -0.1784 0.1459 0 0.1478 -0.2951 -0.3222 -0.5885 0 -0.1634 0.4946 1.0534 0 ```
```Dnew = 5×5 1.0000 0 0 0 0 0 3.8801 5.1046 0 0 0 -5.1046 3.8801 0 0 0 0 0 2.1199 0.7018 0 0 0 -0.7018 2.1199 ```

`Dnew` still has the real eigenvalue, but the complex conjugate eigenvalues are replaced with 2-by-2 blocks.

## Input Arguments

collapse all

Right eigenvector matrix, specified as the matrix returned by ```[V,D] = eig(X)``` or `[V,D] = eigs(X,___)`.

Data Types: `single` | `double`
Complex Number Support: Yes

Diagonal eigenvalue matrix, specified as the matrix returned by ```[V,D] = eig(X)``` or `[V,D] = eigs(X,___)`. Some of the eigenvalues along the diagonal of `D` might be real, but complex conjugate eigenvalue pairs are assumed to be next to one another.

Since `eigs` returns a subset of the eigenvalues and eigenvectors, the requested number of eigenvalues might include half of a complex conjugate pair. `cdf2rdf` returns an error if the `D` input contains incomplete complex conjugate pairs.

Data Types: `single` | `double`
Complex Number Support: Yes

## Output Arguments

collapse all

Transformed right eigenvector matrix, returned as a matrix. The eigenvectors in `V` are transformed so that `X*Vnew = Vnew*Dnew` holds. If the input eigenvector matrix `V` is unitary, then `Vnew` is as well. After the transformation, the individual columns of `Vnew` are no longer eigenvectors of `X`, but each pair of vectors in `Vnew` associated with a 2-by-2 block in `Dnew` spans the corresponding invariant vectors.

Transformed diagonal eigenvalue matrix, returned as a block diagonal real matrix. Complex conjugate eigenvalue pairs in `D` are replaced with 2-by-2 real blocks along the diagonal in `Dnew`.

## Version History

Introduced before R2006a

expand all