Using the C++ Math Library | ![]() ![]() |
Importing Array Data from a MAT-File
Using load()
, you can read in mwArray
data from a binary MAT-file. The prototype for load()
is
:
void load( const mwArray &file, const char* name1, mwArray *var1, const char* name2=NULL, mwArray *var2=NULL, . . . const char* name16=NULL, mwArray *var16=NULL );
file
contains the name of the MAT-file. You must pass at least one pair of arguments indicating the name of a variable that you want to load and a pointer to an mwArray
variable that will receive the data:
mwArray
object that you want to load. mwArray
objects in one call to load()
.mwArray
. load()
allocates the space required based on the size of the variable being read..mat
extension, the library automatically appends it to the filename.For more information on MAT-files, consult the MATLAB Application Program Interface Guide.
![]() | Exporting Array Data to a MAT-File | Example - Using load() and save() (ex7.cpp) | ![]() |