Documentation Center 
How to create continuoustime singleinput, singleoutput (SISO) models.
On this page… 

Transfer Function Model Using Numerator and Denominator Coefficients 
This example shows how to create continuoustime singleinput, singleoutput (SISO) transfer functions from their numerator and denominator coefficients using tf.
Create the transfer function :
num = [1 0]; den = [1 3 2]; G = tf(num,den);
num and den are the numerator and denominator polynomial coefficients in descending powers of s. For example, den = [1 3 2] represents the denominator polynomial s^{2} + 3s + 2.
G is a tf model object, which is a data container for representing transfer functions in polynomial form.
This example shows how to create singleinput, singleoutput (SISO) transfer functions in factored form using zpk.
Create the factored transfer function :
Z = [0]; P = [11i 1+1i 2]; K = 5; G = zpk(Z,P,K);
Z and P are the zeros and poles (the roots of the numerator and denominator, respectively). K is the gain of the factored form. For example, G(s) has a real pole at s = –2 and a pair of complex poles at s = –1 ± i. The vector P = [11i 1+1i 2] specifies these pole locations.
G is a zpk model object, which is a data container for representing transfer functions in zeropolegain (factorized) form.
This example shows how to create a continuoustime singleinput, singleoutput (SISO) statespace model from statespace matrices using ss.
Create a model of an electric motor where the statespace equations are:
where the state variables are the angular position θ and angular velocity dθ/dt:
u is the electric current, the output y is the angular velocity, and the statespace matrices are:
To create this model, enter:
A = [0 1;5 2]; B = [0;3]; C = [0 1]; D = 0; sys = ss(A,B,C,D);
sys is an ss model object, which is a data container for representing statespace models.
Tip To represent a system of the form:
use dss. This command creates a ss model with a nonempty E matrix, also called a descriptor statespace model. See MIMO Descriptor StateSpace Model for an example. 
This example shows how to create a singleinput, singleoutput (SISO) frequencyresponse model using frd.
A frequencyresponse model stores a vector of frequency points with corresponding complex frequency response data you obtain either through simulations or experimentally. Thus, if you measure the frequency response of your system at a set of test frequencies, you can use the data to create a frequency response model:
Load the frequency response data in AnalyzerData.mat.
load AnalyzerData
This command loads the data into the MATLAB^{®} workspace as the column vectors freq and resp. The variables freq and resp contain 256 test frequencies and the corresponding complexvalued frequency response points, respectively.
Create a frequency response model.
sys = frd(resp,freq);
sys is an frd model object, which is a data container for representing frequency response data.
You can use frd models with many frequencydomain analysis commands. For example, visualize the frequency response data using bode.
Tip By default, the frd command assumes that the frequencies are in radians/second. To specify different frequency units, use the TimeUnit and FrequencyUnit properties of the frd model object. For example: sys = frd(resp,freq,'TimeUnit','min','FrequencyUnit','rad/TimeUnit') sets the frequency units to radians/minute. 
How to create models representing PID controllers.
You can represent continuoustime ProportionalIntegralDerivative (PID) controllers in either parallel or standard form. The two forms differ in the parameters used to express the proportional, integral, and derivative actions and the filter on the derivative term, as shown in the following table.
Form  Formula 

Parallel 
where:

Standard 
where:

Use a controller form that is convenient for your application. For example, if you want to express the integrator and derivative actions in terms of time constants, use Standard form.
See DiscreteTime ProportionalIntegralDerivative (PID) Controller for information on creating PID Controllers in discrete time.
This example shows how to create a continuoustime ProportionalIntegralDerivative (PID) controller in parallel form using pid.
Create the following parallelform PID controller:
Kp = 29.5; Ki = 26.2; Kd = 4.3; Tf = 0.06; C = pid(Kp,Ki,Kd,Tf)
C is a pid model object, which is a data container for representing parallelform PID controllers.
This example shows how to create a continuoustime ProportionalIntegralDerivative (PID) controller in standard form using pidstd.
Create the following standardform PID controller:
Kp = 29.5; Ti = 1.13; Td = 0.15; N = 2.3; C = pid(Kp,Ki,Kd,Tf)
C is a pidstd model object, which is a data container for representing standardform PID controllers.