Using the C Math Library | ![]() ![]() |
Reading Data from a MAT-File
Using mlfLoad()
, you can read in mxArray
data from a binary MAT-file. The prototype for mlfLoad()
void mlfLoad(mxArray *file, ... );
where file
points to an mxArray
containing the name of the MAT-file and the variable argument list consists of at least one pair of arguments - the name of the variable that you want to load and a pointer to the address of an mxArray
variable that will receive the data. The last argument to mlfLoad()
is always a NULL
, which terminates the argument list:
mxArray
variable that you want to load. mlfLoad()
.mxArray
. mlfLoad()
allocates the space required based on the size of the variable being read..mat
to the filename if you do not specify it.For more information on MAT-files, consult the online version of the MATLAB Application Program Interface Guide.
![]() | Writing Data to a MAT-File | Example - Saving and Loading Data (ex5.c) | ![]() |