.Modelica_LinearSystems2.StateSpace.Import.fromFile

Information

Syntax

ss = StateSpace.Import.fromFile(fileName, matrixName)

Description

Reads and loads a state space system from a mat-file fileName. The file must contain the matrix [A, B; C, D] named matrixName and the integer nx representing the order of the system, i.e. the number of rows of the square matrix A.

Example


algorithm
  ss:=Modelica_LinearSystems2.StateSpace.Import.fromFile("stateSpace.mat", "ABCD");
//  ss=StateSpace(
      A=[-1, 0, 0; 0, -2, 0; 0, 0, -3],
      B=[1; 1; 0],
      C=[1, 1, 1],
      D=[0])

Interface

encapsulated function fromFile
  import Modelica;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.StateSpace;
  input String fileName = "dslin.mat" "Name of the state space system data file" annotation(
    Dialog(loadSelector(filter = "MAT files (*.mat);; All files (*.*)", caption = "State space system data file")));
  input String matrixName = "ABCD" "Name of the state space system matrix (default is \"ABCD\") in the fileName" annotation(
    Dialog);
  output StateSpace result(redeclare Real A[nx, nx], redeclare Real B[nx, nu], redeclare Real C[ny, nx], redeclare Real D[ny, nu]) "Outputs model read from file";
end fromFile;

Generated at 2024-04-24T18:15:52Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos