List of variables in MAT-file
#include "mat.h" char **matGetDir(MATFile *mfp, int *num);
#include "mat.h" mwPointer matGetDir(mfp, num) mwPointer mfp integer*4 num
mfp
Pointer to MAT-file information
num
Pointer to the variable containing the number ofmxArray
s in the MAT-file
Pointer to an internal array containing pointers to the names of themxArray
s in the MAT-file pointed to bymfp
. In C, each name is aNULL
-terminated string. Thenum
output argument is the length of the internal array (number ofmxArray
s in the MAT-file). Ifnum
is zero,mfp
contains no arrays.
matGetDir
returnsNULL
in C (0
in Fortran). IfmatGetDir
fails, setsnum
to a negative number.
This routine provides you with a list of the names of themxArray
s contained within a MAT-file.
matGetDir
allocates memory for the internal array of strings using amxCalloc
. Free the memory usingmxFree
when you are finished with the array.
MATLAB®variable names can be up to lengthmxMAXNAM
, defined in the C header filematrix.h
.