Mu Analysis and Synthesis Toolbox | ![]() ![]() |
Convert to and from CONSTANT and SYSTEM matrices
Syntax
Description
pss2sys
translates a regular MATLAB matrix that is in packed form into a SYSTEM matrix. mat
contains [A B; C D]
which describes the individual components of a SYSTEM matrix with n
being the number of states (size of A
). sys2pss
returns the CONSTANT matrix, mat
= [A B; C D]
, from the input SYSTEM matrix sys
.
pck
takes consistent state-space data and forms a SYSTEM matrix with the data structure defined. Consistent state-space data requires a square A
matrix, a B
matrix with the same number of rows as A
, a C
matrix with the same number of columns as A
, and a D
matrix with same number of columns of B
and rows of C
. If the fourth input argument is omitted, then the D
matrix is assumed to be identically zero, of appropriate dimensions. unpck
is the inverse operation of pck
, taking a SYSTEM matrix sys
and converting it to A
, B
, C
and D
CONSTANT matrices.
Note that based on the data structure definition, a -Inf
in the bottom right corner of a matrix denotes a SYSTEM matrix, with the top, right corner element of the matrix containing the number of states.
Examples
Create a SYSTEM matrix from MATLAB CONSTANT matrices via pss2sys
. Define matrices A, B, C, and D as follows:
A = [-1 1; -1 -3]; B =[2 2; 2 2]i C = [3 3]; D = [4 4]mat
= [A B; C D]; sys =pss2sys
(mat
,2);minfo
(mat
) 3 rows4 cols: regular MATLAB matrixmat
= -1 1 22 -1 -3 22 3 3 44minfo
(sys) system: 2 states1 outputs2 inputs seesys(sys) -1.0e+00 1.0e+00 | 2.0e+00 2.0e+00 -1.0e+00 -3.0e+00 | 2.0e+00 2.0e+00 ----------------------|---------------------- 3.0e+00 3.0e+00 | 4.0e+00 4.0e+00
pck
command.
sys =pck
(A,B,C,D);minfo
(sys) system: 2 states1 outputs2 inputs seesys(sys) -1.0e+00 1.0e+00 | 2.0e+00 2.0e+00 -1.0e+00 -3.0e+00 | 2.0e+00 2.0e+00 ----------------------|---------------------- 3.0e+00 3.0e+00 | 4.0e+00 4.0e+00
Matrices A, B, C, and D can be constructed from sys
using unpck
.
[A,B,C,D] =unpck
(sys
); A A = -1 1 -1 3 B B = 2 2 2 2 C C = 3 3 D D = 4 4mat
=sys2pss
(sys
);mat
mat
= -1 1 2 2 -1 -3 2 2 3 3 4 4
See Also
minfo
, nd2sys
, vpck
, vunpck
, zp2sys
![]() | negangle | pkvnorm, vnorm | ![]() |