You are on page 1of 2

Robust Control Toolbox

Go to function:

Search

Help Desk

mksys, vrsys, issystem

Examples See Also

Create a single MATLAB variable containing all the matrices describing a system, their dimensions and their "standard" names (depending on the type of system). mksys implements the Robust Control Toolbox system data structure used to simplify user interaction with functions whose input or output variables include state-space systems, transfer function matrices, or other types of systems.

Syntax
S = mksys(a,b,c,d) S = mksys(v1,v2,v3,vn, TY) [VARS,N] = vrsys(NAM) [I,TY,N] = issystem(S)

Description
packs several matrices describing a system of type TY into a MATLAB variable S, under "standard" variable names determined by the value of the string TY as follows:
mksys

Table of System Names Type


'ss' 'des' 'tss' 'tdes' 'gss' 'gdes' 'gpsm' 'tf' 'tfm' 'imp'

V1, V2, ..., Vn


(a,b,c,d,ty) (a,b,c,d,e,ty) (a,b1,b2,c1,c2,d11,d12,d21,d22,e,ty) (a,b1,b2,c1,c2,d11,d12,d21,d22,e,ty) (sm,dimx,dimu,dimy,ty) (e,sm,dimx,dimu,dimy,ty) (psm,deg,dimx,dimu,dimy,ty) (num,den,ty) (num,den,m,n,ty) (y,ts,nu,ny)

Description
Standard state-space (default) Descriptor system Two port state-space Two-port descriptor General state-space General descriptor General polynomial system matrix Transfer function Transfer function matrix Impulse response

The value of TY is packed into S under the name ty. The function branch recovers the individual matrices packed into the system S; e.g.,
[a,b,c,d]=branch(ssg);

See branch and tree for further details. vrsys returns a string VARS and an integer N where VARS contains the list (separated by commas) of the N names of the matrices associated with a system described by the string name NAM. Valid values for the string NAMare strings of the form
[TY '_' SUF]

where SUF is a suffix string which is appended to the standard variable names determined from the table above by the string TY. For example, the MATLAB command [var,n] = vrsys('ss_g'); returns the following:
var = 'ag,bg,cg,dg' n = 4.

returns a value for i of either 1 (true) or 0 (false) depending on whether or not the variable S is a system created by the function mksys. Also returned is the type of system TY and the number N of variable names associated with a system of type TY, except that if S is not a system then TY = [ ]; and N = 0.
issystem

Examples
The following MATLAB commands pack and recover the state-space matrices of any system easily.
% Pack the state-space (ag,bg,cg,dg) into ssg: % (no need to specify 'ss' in this case) ssg = mksys(ag,bg,cg,dg); % Pack a massive two-port state-space into tss: tss = mksys(A,B1,B2,C1,C2,D11,D12,D21,D22,'tss''); % Pack the descriptor state-space (ag,bg,cg,dg,eg) % into desg: desg = mksys(ag,bg,cg,dg,eg,'des');

Now, you can extract any matrix or matrices out of the system variable using branch:
% Extract "ag, dg" out of system variable % "ss_g": [ag,dg] = branch(ssg,'ag,dg'); % Extract "D22,C1,C2" out of system variable % "tss_": [D22,C1,C2] = branch(tss,'D22,C1,C2'); % Extract "ag,eg" out of system variable % "des_g": [ag,eg] = branch(desg,'ag,eg');

See Also
tree, branch, graft, issystem, istree, vrsys

[ Previous | Help Desk | Next ]

You might also like