Next array in MAT-file
#include "mat.h" mxArray *matGetNextVariable(MATFile *mfp, const char **name);
#include "mat.h" mwPointer matGetNextVariable(mfp, name) mwPointer mfp character*(*) name
mfp
Pointer to MAT-file information
name
Pointer to the variable containing themxArray
name
Pointer to a newly allocatedmxArray
structure representing the nextmxArray
从MAT-file指出mfp
. The function returns the name of themxArray
inname
.
matGetNextVariable
returnsNULL
in C (0
in Fortran) for end of file or if there is an error condition. In C, usefeof
andferror
from the Standard C Library to determine status.
matGetNextVariable
allows you to step sequentially through a MAT-file and read everymxArray
in a single pass. The function reads and returns the nextmxArray
从MAT-file指出mfp
.
UsematGetNextVariable
immediately after opening the MAT-file withmatOpen
and not with other MAT-file routines. Otherwise, the concept of thenextmxArray
is undefined.
UsemxDestroyArray
to destroy themxArray
created by this routine when you are finished with it.
The order of variables returned from successive calls tomatGetNextVariable
is not guaranteed to be the same order in which the variables were written.