Robust Control Toolbox | ![]() ![]() |
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.
S = mksys(a,b,c,d) S = mksys(v1,v2,v3,vn, TY) [VARS,N] = vrsys(NAM) [I,TY,N] = issystem(S)
Description
mksys
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:
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 NAM
are 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.
issystem
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
.
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
![]() | ltru, ltry | muopt | ![]() |