# rsf2csf

Convert real Schur form to complex Schur form

## Syntax

``[Unew,Tnew] = rsf2csf(U,T)``

## Description

example

````[Unew,Tnew] = rsf2csf(U,T)` transforms the outputs of `[U,T] = schur(X)` for real matrices `X` from real Schur form to complex Schur form. This operation transforms how the eigenvalues of `X` are expressed in `T`, and transforms `U` such that `X = Unew*Tnew*Unew'` and `Unew'*Unew = eye(size(X))`. In real Schur form, `T` 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}& {t}_{12}& {t}_{13}& {t}_{14}& {t}_{15}& \cdots \\ & a& e& {t}_{24}& {t}_{25}& \cdots \\ & f& a& {t}_{34}& {t}_{35}& \cdots \\ & & & c& g& \cdots \\ & & & h& c& \cdots \\ & & & & & \ddots \end{array}\right]$The eigenvalues represented by these blocks are $a±i\sqrt{-fe}$ and $c±i\sqrt{-hg}$.In complex Schur form, `Tnew` is upper triangular with all eigenvalues, real or complex, on the main diagonal: $\left[\begin{array}{cccccc}{\lambda }_{1}& tne{w}_{12}& tne{w}_{13}& tne{w}_{14}& tne{w}_{15}& \cdots \\ & a+bi& tne{w}_{23}& tne{w}_{24}& tne{w}_{25}& \cdots \\ & & a-bi& tne{w}_{34}& tne{w}_{35}& \cdots \\ & & & c+di& tne{w}_{45}& \cdots \\ & & & & c-di& \cdots \\ & & & & & \ddots \end{array}\right]$ ```

## Examples

collapse all

Apply Schur decomposition to a real matrix, and then transform the matrix factors so that the eigenvalues are directly on the main diagonal.

Create a real matrix and calculate the Schur decomposition. The `U` factor is unitary so that ${\mathit{U}}^{\mathit{T}}\mathit{U}={\mathit{I}}_{\mathit{N}}$, and the `T` factor is in real Schur form with complex conjugate eigenvalue pairs expressed as 2-by-2 blocks on the diagonal.

```X = [1 1 1 3 1 2 1 1 1 1 3 1 -2 1 1 4]; [U,T] = schur(X)```
```U = 4×4 -0.4916 -0.4900 -0.6331 -0.3428 -0.4980 0.2403 -0.2325 0.8001 -0.6751 0.4288 0.4230 -0.4260 -0.2337 -0.7200 0.6052 0.2466 ```
```T = 4×4 4.8121 1.1972 -2.2273 -1.0067 0 1.9202 -3.0485 -1.8381 0 0.7129 1.9202 0.2566 0 0 0 1.3474 ```

`T` has two real eigenvalues on the diagonal and one 2-by-2 block representing a complex conjugate pair of eigenvalues.

Transform `U` and `T` so that `Tnew` is upper triangular with the eigenvalues on the diagonal, and `Unew` satisfies `X = Unew*Tnew*Unew'`.

`[Unew,Tnew] = rsf2csf(U,T)`
```Unew = 4×4 complex -0.4916 + 0.0000i -0.2756 - 0.4411i 0.2133 + 0.5699i -0.3428 + 0.0000i -0.4980 + 0.0000i -0.1012 + 0.2163i -0.1046 + 0.2093i 0.8001 + 0.0000i -0.6751 + 0.0000i 0.1842 + 0.3860i -0.1867 - 0.3808i -0.4260 + 0.0000i -0.2337 + 0.0000i 0.2635 - 0.6481i 0.3134 - 0.5448i 0.2466 + 0.0000i ```
```Tnew = 4×4 complex 4.8121 + 0.0000i -0.9697 + 1.0778i -0.5212 + 2.0051i -1.0067 + 0.0000i 0.0000 + 0.0000i 1.9202 + 1.4742i 2.3355 - 0.0000i 0.1117 + 1.6547i 0.0000 + 0.0000i 0.0000 + 0.0000i 1.9202 - 1.4742i 0.8002 + 0.2310i 0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i 1.3474 + 0.0000i ```

## Input Arguments

collapse all

Unitary matrix, specified as the matrix returned by ```[U,T] = schur(X)```. The matrix `U` satisfies ```U'*U = eye(size(X))```.

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

Schur form, specified as the matrix returned by `[U,T] = schur(X)`. The matrix `T` satisfies `X = U*T*U'`. The Schur form has real eigenvalues on the diagonal, and complex eigenvalues are expressed as 2-by-2 real blocks along the main diagonal.

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

## Output Arguments

collapse all

Transformed unitary matrix, returned as a matrix. The matrix `Unew` satisfies `Unew'*Unew = eye(size(X))`.

Transformed Schur form, returned as a matrix. `Tnew` is upper triangular with the eigenvalues of `X` on the diagonal, and it satisfies `X = Unew*Tnew*Unew'`.

## Tips

• You can use `ordeig` to obtain the same eigenvalue ordering as `rsf2csf` from the results of a Schur decomposition. However, `rsf2csf` also returns the remainder of the Schur matrix `T` and Schur vector matrix `U`, transformed to complex representation.