Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

matGetNextVariableInfo (C and Fortran) - Load array header information only

C Syntax

#include "mat.h"
mxArray *matGetNextVariableInfo(MATFile *mfp, const char **name);

Fortran Syntax

mwPointer matGetNextVariableInfo(mfp, name)
mwPointer mfp
character*(*) name

Arguments

mfp

Pointer to MAT-file information

name

Pointer to the variable containing the mxArray name

Returns

Pointer to a newly allocated mxArray structure representing header information for the next mxArray from the MAT-file pointed to by mfp. The function returns the name of the mxArray in name.

matGetNextVariableInfo returns NULL in C (0 in Fortran) when the end-of-file is reached or if there is an error condition. In C, use feof and ferror from the Standard C Library to determine status.

Description

matGetNextVariableInfo loads only the array header information, including everything except pr, pi, ir, and jc, from the file's current file offset.

If pr, pi, ir, and jc are set to nonzero values when loaded with matGetVariable, matGetNextVariableInfo sets them to -1 instead. These headers are for informational use only and should never be passed back to the MATLAB workspace or saved to MAT-files.

Use mxDestroyArray to destroy the mxArray created by this routine when you are finished with it.

The order of variables returned from successive calls to matGetNextVariableInfo is not guaranteed to be the same order in which the variables were written.

C Examples

See matdgns.c in the matlabroot/extern/examples/eng_mat folder for sample programs that illustrate how to use the MAT-file routines in a C program.

See Also

matGetNextVariable, matGetVariableInfo

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS