Introduction to Simulink with Engineering Applications


The Gain block multiplies the input by a constant value (gain). The input and the gain can each be a scalar, vector, or matrix. We specify the value of the gain in the Gain parameter. The Multiplication parameter lets us specify element-wise or matrix multiplication. For matrix multiplication, this parameter also lets us indicate the order of the multiplicands.
The model shown in Figure 2.20 performs the matrix multiplication A B where A = [1 _1 2]' and B = [2 3 4].
We double-click on the Constant block and we enter[1 -1 2]' The apostrophe is required to indicate that this is a column vector. Next, we double click on the Gain block, we enter the row vector [2 3 4] , and for Multiplication we choose Matrix (u*K). Initially, the Display block may show just one value with two small black triangles. This tells us that we must resize the Display block in both directions to see all the elements of the resultant 3 3 matrix.