| MATLAB Application Program Interface Reference | Help Desk |
matGetArray
Read mxArrays from MAT-files
#include "mat.h" mxArray *matGetArray(MATFile *mfp, const char *name);
mfpPointer to MAT-file information.
nameName of mxArray to get from MAT-file.
This routine allows you to copy an mxArray out of a MAT-file.matGetArray reads the named mxArray from the MAT-file pointed to by mfp and returns a pointer to a newly allocated mxArray structure, or NULL if the attempt fails.
Be careful in your code to free the mxArray created by this routine when you are finished with it.
See matdemo.c in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to use the MATLAB MAT-file routines in a C program.