ss = StateSpace.Import.fromFile(fileName, matrixName)
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.
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])
encapsulated function fromFile import Modelica; import Modelica_LinearSystems2.Utilities.Streams; 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]) "State space description of model read from file"; end fromFile;