This functions writes an array to a CSV file including header. If the header is not specified explicitely, the header is not written to the CSV file. Each row of the header string is written to the CSV file. However, the number of columns of matrix and header have to match.

File format


function writeRealCSV
  extends Modelica.Icons.Function;
  input String fileName = "Name of file" annotation(
    Dialog(saveSelector(filter = "Comma separated values (*.csv)", caption = "CSV data file")));
  input String delimiter = "\t" "Delimiter";
  input Real matrix[:, :] "Actual matrix to be written to CSV file";
  input String[:, :] header = fill("", 0, size(matrix, 2)) "Header lines to be written to CSV file";
  input Integer significantDigits = 6 "Number of significant digits";
end writeRealCSV;

Generated at 2021-03-04T02:00:13Z by OpenModelicaOpenModelica 1.18.0~dev-106-gaf583a5 using GenerateDoc.mos