| 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.
Syntax
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:
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.,
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
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:
n
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');
% 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 | ![]() |