DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Declaration: SaveMatrixAsASC(FName: string; Data: TDouble2DArray; Comment: string; ColNames, RowNames: TStrArray): integer;
Saves the values of the matrix Data as the file FName in the ASC format1). The parameter Comment specifies an optional comment (one line only, newline characters will be automatically removed).

The open string arrays ColNames and RowNames define the names of the matrix columns and rows, respectively. The sizes of the ColNames/RowNames array need not be equal to the number of columns/rows of the matrix - if fewer names are contained only the first columns/rows are named according to the corresponding array. If the number of entries exceeds the number of columns/rows the superfluous entries are ignored.

The function returns the following error codes:

 0 ... everything is ok
-1 ... number of ColNames does not match the number of matrix columns (warning only)
-2 ... number of RowNames does not match the number of matrix rows (warning only)
-3 ... data could not be saved (readonly file)
-4 ... Data array must not be empty

1) The ASC data format is a text based format which can be read by DataLab.