| MATLAB® | ![]() |
Get directory of mxArrays in MAT-file
#include "mat.h" char **matGetDir(MATFile *mfp, int *num);
mwPointer matGetDir(mfp, num) mwPointer mfp integer*4 num
Pointer to MAT-file information
Address of the variable to contain the number of mxArrays in the MAT-file
A pointer to an internal array containing pointers to the names of the mxArrays in the MAT-file pointed to by mfp. In C, each name is a NULL-terminated string. The length of the internal array (number of mxArrays in the MAT-file) is placed into num. If num is zero, mfp contains no arrays.
matGetDir returns NULL in C (0 in Fortran) and sets num to a negative number if it fails.
This routine allows you to get a list of the names of the mxArrays contained within a MAT-file.
The internal array of strings that matGetDir returns is allocated using a single mxCalloc and must be freed using mxFree when you are finished with it.
MATLAB® variable names can be up to length mxMAXNAM, where mxMAXNAM is defined in the C header file matrix.h.
See matcreat.c and matdgns.c in the eng_mat subdirectory of the examples directory for sample programs that illustrate how to use the MATLAB MAT-file routines in a C program.
See matdemo2.F in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to use this MAT-file routine in a Fortran program.
![]() | MATFile (C and Fortran) | matGetFp (C) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |