You are here : matlabSignal Processingzp2ss

# zp2ss() - Signal Processing

```zp2ss converts a zero-pole-gain representation
of a given system to an equivalent state-space representation. [A,B,C,D] = zp2ss(z,p,k) finds
a single input, multiple output, state-space representationx˙=Ax+Buy=Cx+Dugiven a system in factored transfer function form.H(s)=Z(s)P(s)=k(s−z1)(s−z2)⋯(s−zn)(s−p1)(s−p2)⋯(s−pn)Column vector p specifies the pole locations,
and matrix z the zero locations with as many columns
as there are outputs. The gains for each numerator transfer function
are in vector k. The A, B, C,
and D matrices are returned in controller canonical
form.Inf values may be used as place holders in z if
some columns have fewer zeros than others.```

### Syntax

`[A,B,C,D] = zp2ss(z,p,k)`

### Example

```State-Space Representation of Mass-Spring SystemOpen This ExampleGenerate the state-space representation of a damped mass-spring system that obeys the differential equation
The measurable quantity is the acceleration,
, and
is the driving force. In Laplace space, the system is represented by
The system has unit gain, a double zero at
, and two complex-conjugate poles.z = [0 0];
p = roots([1 0.01 1])
k = 1;

p =

-0.0050 + 1.0000i
-0.0050 - 1.0000i

Use zp2ss to find the state-space matrices.[A,B,C,D] = zp2ss(z,p,k)

A =

-0.0100   -1.0000
1.0000         0

B =

1
0

C =

-0.0100   -1.0000

D =

1```