.Modelica_LinearSystems2.Internal.Streams.ReadMatrixC

Information

Syntax

C = Streams.ReadMatrixC(fileName, matrixName);

Description

Opens the given MATLAB MAT file and reads the matrix C 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 C matrix of the linearized system
ReadMatrixC(dslin.mat, "ABCD")
//  = 
// [0.9999999999670585, 0.0, 0.0, 0.0, 0.0, 0.0;
// 0.0, 1.0000000001008236, 0.0, 0.0, 0.0, 0.0;
// 0.0, 0.0, 1.0000000005428915, 0.0, 0.0, 0.0;
// 0.0, 0.0, 0.0, 1.000000000091112, 0.0, 0.0;
// 0.0, 0.0, 0.0, 0.0, 0.9999999999578305, 0.0;
// 0.0, 0.0, 0.0, 0.0, 0.0, 1.000000000038966;
// 0.0, 0.0, 0.0, 0.0, 0.0, 0.0;
// 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Interface

function ReadMatrixC
  extends partialReadStateSpaceMatrix;
  extends Modelica.Icons.Function;
  output Real C[ny, nx] = matrixABCD[nx + 1:nx + ny, 1:nx];
end ReadMatrixC;

Generated at 2024-04-26T18:16:04Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos