Mu Analysis and Synthesis Toolbox    
madd, msub

Add and subtract CONSTANT, SYSTEM, and VARYING matrices

Syntax

Description
madd (msub) allows the addition or subtraction of matrices, regardless of their type, as long as their dimensions are compatible. CONSTANT, SYSTEM, and VARYING matrices can be added to or subtracted from one another based on the following table:


mat2
CONSTANT
SYSTEM
VARYING
mat1




CONSTANT

yes
yes
yes
SYSTEM

yes
yes
no
VARYING

yes
no
yes

For compatibility, the number of rows and columns of mat1 must equal the number of rows and columns of mat2. In the case of SYSTEM matrices, the number of inputs and outputs of mat1 must equal the number of inputs and outputs of mat2. The same is true for VARYING matrices and in addition, the independent variables of the VARYING matrices must be identical. Up to nine matrices of compatible dimension can be added or subtracted by including them as input arguments.

Pictorial Representationof Functions



Examples
Create two SYSTEM matrices p and p1 and a CONSTANT matrix.

Adding two SYSTEM matrices returns a SYSTEM matrix with the same number of inputs and outputs as p and p1.

Adding a SYSTEM matrix and a CONSTANT matrix returns a SYSTEM matrix with the CONSTANT term added to the D-term of the state-space system.

Subtracting a SYSTEM matrix and a CONSTANT returns a SYSTEM matrix with the CONSTANT term added to the D-term of the state-space system.

Algorithm
madd and msub call the MATLAB + and - commands consistent with the type of matrices.

See Also
+, -, mmult, mscl



indvcmp massign