functionreadMatrixB

Read the input matrix of a state space system

Extends from Internal.partialReadStateSpaceMatrix (Read the ABCD matrix of the state space form of a system from MAT file).

Information

Syntax

B = Streams.readMatrixB(fileName, matrixName);

Description

Opens the given MATLAB MAT file and reads the matrix B of a state space system from this file.

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
readMatrixB("dslin.mat", "ABCD")
//  = 
// [0.0;
//  0.13297862810901506;
//  0.0;
// -0.022602364424528787;
//  0.0;
// -0.11931966525935421]

Inputs

TypeNameDefaultDescription
StringfileName (from partialReadStateSpaceMatrix)"dslin.mat"File where matrixName data is stored
StringmatrixName (from partialReadStateSpaceMatrix)"ABCD"Name of the generalized state space system matrix on file

Outputs

TypeNameDefaultDescription
Real[nx,nu]BmatrixABCD[1:nx, nx + 1:nx + nu]