In file DMatrix.cpp:

DIVAMatrixExport void CDMatrix::ToMatlab( const CDString& sFilename, const CDString& sName, const CDString& sComment, bool fAppend) const

Writes the matrix to disk in MatLab (.m) format.

Documentation

Writes the matrix to disk in MatLab (.m) format. To read the matrix into MatLab write e.g. 'my_matrix.m' at the MatLab prompt.

Notice that this should be used for storage a (really) large matrices, due to the computational and i/o overhead induced by the simple MatLab text format.

Also, remember that MatLab can't read (.m) files with lines longer than 4096 bytes.

If no communication with MatLab is needed, but merely to/from disk functionality within a DIVA program, it is suggested to use the fast binary i/o methods ToFile() and FromFile().

Returns:
Nothing.
Parameters:
sFilename - Output file name. Should have the extension '.m'.
sName - Name of destination matlab variable.
sComment - Optional comment inside the file.
fAppend - If true, the vector is appended to the file 'sFilename'.
Author:
Henrik Aanęs
Version:
14-7-1999


Back DIVA Reference Manual The DIVA-Site