Using the C++ Math Library | ![]() ![]() |
Exporting Array Data to a MAT-File
Using save()
, you can save the data within mwArray
variables to disk. The prototype for save()
is:
void save(const mwArray &file, const char* mode, const char* name1, const mwArray &var1, const char* name2=NULL, const mwArray &var2=mwArray::DIN, . . . const char* name16=NULL, const mwArray &var16=mwArray::DIN );
file
contains the name of the MAT-file; mode
points to a string that indicates whether you want to overwrite or update the data in the file. You must pass at least one pair of arguments indicating the name you want to assign to the data you're saving and the address of the mwArray
variable that you want to save:
mwArray
variable that you save to disk. A name can contain up to 32 characters.save()
..mat
. The library appends the extension .mat
to the filename if you do not specify it."w"
to overwrite, "u"
to update (append), "w4"
to overwrite using V4 format. A second version of the save()
function allows you to omit the mode
argument; the default is to overwrite the data.![]() | Importing and Exporting MAT-File Data | Importing Array Data from a MAT-File | ![]() |