| Mu Analysis and Synthesis Toolbox | ![]() |
Select rows/outputs and columns/inputs from a CONSTANT, SYSTEM or VARYING matrix or reorder the SYSTEM states
Syntax
Description
sel selects desired rows and columns from a CONSTANT/VARYING matrix, or outputs and inputs from a SYSTEM matrix. For CONSTANT and VARYING matrices, the rows and cols input arguments are row vectors with the desired rows/columns of mat specified. For SYSTEM matrices, outputs and inputs are row vectors with the desired inputs/outputs specified. Use the string ':' to specify all rows (inputs) and/or columns (outputs).
reordsys reorders the states of SYSTEM matrix sys as defined by the vector of position variables, index. The index variable is restricted to be the same length as the number of states of sys. This command can be used in conjunction with strans and sresid to reduce the states of a SYSTEM matrix.
Examples
You can use the sel command with any matrix type. First, construct and display a one state, two output, three input SYSTEM matrix.
minfo(sys) system:1 states2 outputs3 inputs seesys(sys) 1.0e+00 | 2.0e+00 3.0e+00 4.0e+00 ---------|------------------------------ 5.0e+00 | 6.0e+00 7.0e+00 8.0e+00 9.0e+00 | 1.0e+01 1.1e+01 1.2e+01
sys to be output 2, 1 and repeat output 2; also reorder the inputs to be input 3, 1 and 2.
sys2 =sel(sys,[2 1 2],[3 1 2]);minfo(sys2) system:1 states3 outputs3 inputsseesys(sys2) 1.0e+00 | 4.0e+00 2.0e+00 3.0e+00 ---------|------------------------------ 9.0e+00 | 1.2e+01 1.0e+01 1.1e+01 5.0e+00 | 8.0e+00 6.0e+00 7.0e+00 9.0e+00 | 1.2e+01 1.0e+01 1.1e+01
sysg=frsp(sys,logspace(-1,0,2));see(sysg) 2 rows3 columns indep variable 0.1 -3.9010 - 0.9901i -7.8515 - 1.4851i -11.8020 - 1.9802i -7.8218 - 1.7822i -15.7327 - 2.6733i -23.6436 - 3.5644i indep variable 1 1.0000 - 5.0000i -0.5000 - 7.5000i -2.0000 - 10.0000i 1.0000 - 9.0000i -2.5000 - 13.5000i -6.0000 - 18.0000i
part =sel(sysg,[2 1],[3 2]); see(part) 2 rows2 columns indep variable 0.1 -23.6436 - 3.5644i -15.7327 - 2.6733i -11.8020 - 1.9802i -7.8515 - 1.4851i indep variable 1 -6.0000 - 18.0000i -2.5000 - 13.5000i -2.0000 - 10.0000i -0.5000 - 7.5000i
reordsys interchanges states in a SYSTEM matrix. The matrix (sys) has four states, two inputs, and one output and it is to be reordered so that states three and four interchange with states one and two in the state-space system.
minfo(sys) system: 4 states1 outputs2 inputs seesys(sys) 1.5e-01 -1.3e-01 0.0e+00 0.0e+00 | 2.4e-01 2.3e-01 1.3e-01 1.5e-01 0.0e+00 0.0e+00 | -4.4e-01 -2.2e-01 0.0e+00 0.0e+00 -6.2e-01 0.0e+00 | -6.5e-01 -3.9e-01 0.0e+00 0.0e+00 0.0e+00 2.0e+00 | 1.2e+00 7.2e-01 ----------------------------------------|-------------------- -9.7e-02 -1.2e-01 -1.3e-01 1.1e+00 | 0.0e+00 0.0e+00sysout= reordsys(sys,[3 4 1 2]);minfo(sysout) system: 4 states1 outputs2 inputs seesys(sysout) -6.2e-01 0.0e+00 0.0e+00 0.0e+00 | -6.5e-01 -3.9e-01 0.0e+00 2.0e+00 0.0e+00 0.0e+00 | 1.2e+00 7.2e-01 0.0e+00 0.0e+00 1.5e-01 -1.3e-01 | 2.4e-01 2.3e-01 0.0e+00 0.0e+00 1.3e-01 1.5e-01 | -4.4e-01 -2.2e-01 ---------------------------------------|--------------------- -1.3e-01 1.1e+00 -9.7e-02 -1.2e-01 | 0.0e+00 0.0e+00
See Also
getiv, sresid, strunc, unpck, vunpck
![]() | seesys | siggen | ![]() |