xuy = Streams.readSystemDimension(fileName, matrixName);
Opens the given MATLAB MAT file and reads the dimensions of
state matrix matrixName. Returns the order nx of the
matrix and the numbers nu and ny of inputs and outputs, ordered
as
xuy[3] = {nx, nu, ny};
// Generate dslin.mat of the double pendulum example first
Modelica_LinearSystems2.Utilities.Import.linearize(
"Modelica_LinearSystems2.Utilities.Plants.DoublePendulum", 1.0);
// Read dimensions of state matrix of the linearized system
readSystemDimension("dslin.mat", "ABCD")
// = {6, 1, 8}
function readSystemDimension
extends Modelica.Icons.Function;
import Modelica.Utilities.Streams;
input String fileName = "stateSpace.mat" "File containing the matrix matrixName, e.g. A.mat, dsin.txt" annotation(
Dialog(loadSelector(filter = "MAT files (*.mat);; All files (*.*)", caption = "State space system data file")));
input String matrixName = "ABCD" "Name of the generalized state space system matrix";
output Integer xuy[3] "Order of matrixName; size of u; size of y";
end readSystemDimension;