matrix = Streams.readRealMatrix(fileName, matrixName, nrow, ncol, verboseRead)
Function readRealMatrix(..) opens the given MATLAB MAT file (in format v4, v6, v7, and if HDF is supported in the Modelica tool, also v7.3), and reads the given matrix from this file. The dimensions of this matrix must first be inquired with function readMatrixSize and passed via arguments nrow and ncol to this function.
See Examples.ReadRealMatrixFromFile.
readMatrixSize, writeRealMatrix
impure function readRealMatrix extends Modelica.Icons.Function; input String fileName "File where external data is stored" annotation( Dialog(loadSelector(filter = "MATLAB MAT files (*.mat)", caption = "Open MATLAB MAT file"))); input String matrixName "Name / identifier of the 2D Real array on the file"; input Integer nrow "Number of rows of the 2D Real array"; input Integer ncol "Number of columns of the 2D Real array"; input Boolean verboseRead = true "= true: Print info message; = false: No info message"; output Real matrix[nrow, ncol] "2D Real array"; end readRealMatrix;