In file DVector.cpp:

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

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

Documentation

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

Notice that this should be used for storage a (really) large vectors, 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:
2-5-2001


Back DIVA Reference Manual The DIVA-Site