Model Conversion

Available Model Formats

You can use the following LTI model formats:

This section shows how to convert models from one format to the other.

Explicit Conversion

Model conversions are performed by tf, ss, zpk, and frd. Given any TF, SS, or ZPK model sys, the syntax for conversion to another model type is

sys = tf(sys)

% Conversion to TF

sys = zpk(sys)

% Conversion to ZPK

sys = ss(sys)

% Conversion to SS

sys = frd(sys,frequency)

% Conversion to FRD

Notice that FRD models can't be converted to the other model types. In addition, you must also include a vector of frequencies (frequency) as an input argument when converting to an FRD model.

For example, you can convert the state-space model

sys = ss(-2,1,1,3)

to a zero-pole-gain model by typing

zpk(sys)

This command results in

Zero/pole/gain:
3 (s+2.333)
-----------
   (s+2)

Note that the transfer function of a state-space model with data is

for continuous-time models, and

for discrete-time models.

Automatic Conversion

Some algorithms operate only on one type of LTI model. For example, the algorithm for zero-order-hold discretization with c2d can only be performed on state-space models. Similarly, commands like tfdata expect one particular type of LTI models (TF). For convenience, such commands automatically convert LTI models to the appropriate or required model type. For example, in

sys = ss(0,1,1,0)
[num,den] = tfdata(sys)

tfdata first converts the state-space model sys to an equivalent transfer function in order to return numerator and denominator data.

Conversions to state-space models are not uniquely defined. For this reason, automatic conversions to state space are disabled when the result depends on the choice of state coordinates, for example, in commands like initial or kalman.

Caution About Model Conversions

When manipulating or converting LTI models, keep in mind that:

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS