| Using the C Math Library | ![]() |
Writing Data to a MAT-File
Using mlfSave(), you can save the data within mxArray variables to disk. The prototype for mlfSave() is
void mlfSave(mxArray *file, const char* mode, ... );
where file points to an mxArray containing the name of the MAT-file and mode points to a string that indicates whether you want to overwrite or update the data in the file. The variable argument list consists of at least one pair of arguments - the name you want to assign to the variable you're saving and the address of the mxArray variable that you want to save. The last argument to mlfSave() is always a NULL, which terminates the argument list:
mxArray variable that you save to disk. A name can contain up to 32 characters.mlfSave()..mat. The library appends the extension .mat to the filename if you do not specify it."w" to overwrite, "u" to update (append), or "w4" to overwrite using V4 format. | Importing and Exporting Array Data | Reading Data from a MAT-File | ![]() |