# zp2ss

Zero-pole to state-space conversion.

## Syntax

[A, B, C, D] = zp2ss(Z, P, K)

## Inputs

`Z`- Zero locations.
`P`- Pole locations.
`K`- System gain factor.

## Outputs

- A
- The state matrix (n x n), where n is the number of states.
- B
- The input matrix (n x p), where p is the number of inputs.
- C
- The output matrix (q x n), where q is the number of outputs.
- D
- The direct transmission matrix (q x p).

## Examples

```
z = [-1.00013 + 0.00013i, -1.00013 - 0.00013i, -0.99987 + 0.00013i, -0.99987 - 0.00013i];
p = [0.44883 + 0.57074i, 0.44883 - 0.57074i, 0.33637 + 0.17717i, 0.33637 - 0.17717i];
k = 0.0185630106;
[A, B, C, D] = zp2ss(z, p, k)
```

```
A = [Matrix] 4 x 4
1.57040 -1.27561 0.48440 -0.07620
1.00000 0.00000 0.00000 0.00000
0.00000 1.00000 0.00000 0.00000
0.00000 0.00000 1.00000 0.00000
B = [Matrix] 4 x 1
1
0
0
0
C = [Matrix] 1 x 4
0.10340 0.08770 0.08324 0.01715
D = 0.0185630106
```