functionreadMatrixB2
Read the input matrix of a state space system
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
B = Streams.readMatrixB2(fileName, matrixName, nx, nu);
Description
Opens the given MATLAB MAT file and returns the submatrix B of the matrix
matrixName given as
B[nx, nu] = matrixName[1:nx, nx+1:nx+nu];
Example
// Generate dslin.mat of the double pendulum example first
Modelica_LinearSystems2.Utilities.Import.linearize(
"Modelica_LinearSystems2.Utilities.Plants.DoublePendulum", 1.0);
// Read B matrix of the linearized system
readMatrixB2("dslin.mat", "ABCD", 6, 1)
// =
// [0.0;
// 0.13297862810901506;
// 0.0;
// -0.022602364424528787;
// 0.0;
// -0.11931966525935421]
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| String | fileName | DataDir + "abcd.mat" | |
| String | matrixName | "ABCD" | Name of the generalized state space system matrix |
| Integer | nx | System order | |
| Integer | nu | Number of inputs |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[nx,nu] | B | ABCD[1:nx, nx + 1:nx + nu] |