External Interfaces/API Reference | ![]() ![]() |
Get next mxArray
from MAT-file
Fortran Syntax
integer*4 function matGetNextMatrix(mfp) integer*4 mfp
Arguments
mfp
Pointer to MAT-file information.
Description
This routine allows you to step sequentially through a MAT-file and read all the mxArray
s
in a single pass.
matGetNextMatrix
reads the next mxArray
from the MAT-file pointed to by mfp
and returns a pointer to a newly allocated mxArray
structure. Use it immediately after opening the MAT-file with matOpen
and not in conjunction with other MAT-file routines. Otherwise, the concept of the next mxArray
is undefined.
matGetNextMatrix
returns 0 when the end-of-file is reached or if there is an error condition.
Be careful in your code to free the mxArray
created by this routine when you are finished with it.
Example
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.
![]() | matGetMatrix | matGetString | ![]() |