You are on page 1of 3

Command Function

- Construct transfer function or convert to transfer function.


- SYS = tf(NUM,DEN) creates a continuous-time transfer function SYS
with numerator NUM and denominator DEN.
tf - S = tf('s') specifies the transfer function H(s) = s (Laplace variable).
- You can then specify transfer functions directly as expressions in S or Z,
for example, s = tf('s'); H = exp(-s)*(s+1)/(s^2+3*s+1)
- SYS = tf(M) specifies a static gain matrix M.
- Construct state-space model or convert model to state space.
- SYS = ss(A,B,C,D) creates an object SYS representing the continuous-
ss time state-space model
dx/dt = Ax(t) + Bu(t)
y(t) = Cx(t) + Du(t)
- Constructs zero-pole-gain model or converts to zero-pole-gain format.
- SYS = zpk(Z,P,K) creates a continuous-time zero-pole-gain (zpk) model
zpk
- SYS with zeros Z, poles P, and gains K. SYS is an object of class @zpk.
- S = zpk('s') specifies H(s) = s (Laplace variable).
- Create a pid controller in parallel form.
- SYS = pid(Kp,Ki,Kd,Tf) creates a continuous-time pid controller in
parallel form with a first order derivative filter:
- Kp + Ki/s + kd*s/(Tf*s+1)
- When Kp, Ki, Kd and Tf are scalar, the output SYS is a pid object that
represents a single-input-single-output pid controller. The following
rules apply to construct a valid pid controller in parallel form:
Kp (proportional gain) must be real and finite
pid Ki (integral gain) must be real and finite
Kd (derivative gain) must be real and finite
Tf (filter time constant) must be real, finite and non-negative
- The default values are Kp=1, Ki=0, Kd=0 and Tf=0. If a parameter is
omitted, its default value is used. For example:
pid(Kp) returns a proportional only controller
pid(Kp,Ki) returns a PI controller
pid(Kp,Ki,Kd) returns a pid controller
pid(Kp,Ki,Kd,Tf) returns a pid controller with derivative filter
- Pole-zero map of dynamic systems.
- pzmap(SYS) computes the poles and (transmission) zeros of the dynamic
system SYS and plots them in the complex plane. The poles are plotted
as x's and the zeros are plotted as o's.
- pzmap(SYS1,SYS2,...) shows the poles and zeros of several systems
pzmap SYS1,SYS2,... on a single plot. You can specify distinctive colors for
each model, for example:
pzmap(sys1,'r',sys2,'y',sys3,'g')
- [P,Z] = pzmap(SYS) returns the poles and zeros of the system in two
column vectors P and Z. No plot is drawn on the screen.
- Computes the poles of linear systems.
- P = pole(SYS) returns the poles P of the dynamic system SYS as a
pole
column vector. For state-space models, the poles are the eigenvalues of
the A matrix
- Computes zeros and gain of a SISO linear system.
zero - [Z,G] = zero(SYS) computes the zeros Z and gain G of the single-input,
single-output dynamic system SYS.
- Step response of dynamic systems.
- step(SYS) plots the impulse response of the dynamic system SYS.
step - [Y,T] = step(SYS) computes the step response Y of the dynamic system
SYS. The time vector T is expressed in the time units of SYS and the
time step and final time are chosen automatically.
- Impulse response of dynamic systems.
- impulse(SYS) plots the impulse response of the dynamic system SYS.
- [Y,T] = impulse(SYS) computes the impulse response Y of the dynamic
system SYS. The time vector T is expressed in the time units of SYS and
impulse
the time step and final time are chosen automatically.
- For systems with more than one input, independent impulse commands
are applied to each input channel. The time range and number of points
are chosen automatically.
- Root locus plot of dynamic system.
- rlocus(SYS) computes and plots the root locus of the single-input,
single-output LTI model SYS. The root locus plot is used to analyze the
rlocus
negative feedback loop and shows the trajectories of the closed-loop
poles when the feedback gain K varies from 0 to Inf.
- rlocus(SYS,K) uses a user-specified vector K of gain values.
- Bode frequency response of dynamic systems.
- bode(SYS) draws the Bode plot of the dynamic system SYS. The
frequency range and number of points are chosen automatically.
bode
- bode(SYS,{WMIN,WMAX}) draws the Bode plot for frequencies
between WMIN and WMAX in radians/TimeUnit (relative to the time
units specified in SYS.TimeUnit, the default being seconds).
- Gain and phase margins and crossover frequencies.
- [Gm,Pm,Wcg,Wcp] = margin(SYS) computes the gain margin Gm, the
margin
phase margin Pm, and the associated frequencies Wcg and Wcp, for the
SISO open-loop model SYS (continuous or discrete).
- Simulate time response of dynamic systems to arbitrary inputs.
- lsim(SYS,U,T) plots the time response of the dynamic system SYS to the
input signal described by U and T. The time vector T is expressed in the
time units of SYS and consists of regularly spaced time samples. The
matrix U has as many columns as inputs in SYS and its i-th row specifies
lsim
the input value at time T(i). For example,
t = 0:0.01:5; u = sin(t); lsim(sys,u,t)
simulates the response of a single-input model SYS to the input
u(t)=sin(t) during 5 time units.
- SISO Design Tool.
- sisotool opens the SISO Design Tool. This Graphical User Interface lets
you design single-input/single-output (SISO) compensators by
sisotool graphically interacting with the root locus, Bode, and Nichols plots of
the open-loop system.
- sisotool(G) specifies the plant model G to be used in the SISO Tool.
Here G is any linear model created with TF, ZPK, or SS.
- Feedback connection of two input/output systems.
- M = feedback(M1,M2) computes a closed-loop model M for the
feedback feedback loop. Negative feedback is assumed and the model M maps u
to y. To apply positive feedback, use the syntax M =
feedback(M1,M2,+1).
- Series connection of two input/output models.
- M = series(M1,M2,OUTPUTS1,INPUTS2) connects the input/output
series models M1 and M2 in series. The vectors of indices OUTPUTS1 and
INPUTS2 specify which outputs of M1 and which inputs of M2 are
connected together. The resulting model M maps u1 to y2.
- plot(X,Y) creates a 2-D line plot of the data in Y versus the
corresponding values in X.
- If X and Y are both vectors, then they must have equal length. The plot
function plots Y versus X.
- If X and Y are both matrices, then they must have equal size. The plot
function plots columns of Y versus columns of X.
- PLOT(X,Y,S) where S is a character string made from one element
from any or all the following 3 columns:

b blue . point - solid


g green o circle : dotted
r red x x-mark -. dashdot
plot c cyan + plus -- dashed
m magenta * star (none) no line
y yellow s square
k black d diamond
w white v triangle (down)
^ triangle (up)
< triangle (left)
> triangle (right)
p pentagram
h hexagram
- For example, PLOT(X,Y,'c+:') plots a cyan dotted line with a plus at
each data point; PLOT(X,Y,'bd') plots blue diamond at each data point
but does not draw any line.

You might also like