Main Content

mxCreateStructMatrix (Fortran)

2-D structure array

Fortran Syntax

#include "fintrf.h"
mwPointer mxCreateStructMatrix(m, n, nfields, fieldnames)
mwSize m, n
integer*4 nfields
character*(*) fieldnames(nfields)


Call mxCreateStructMatrix to create an unpopulated, two-dimensional, structure mxArray. For information about the structure, see mxCreateStructArray.

Call mxDestroyArray when you finish using the mxArray. mxDestroyArray deallocates the mxArray and its associated elements.

Input Arguments

expand all

Number of rows, specified as mwSize.

Number of columns, specified as mwSize.

Number of fields in each element, specified as integer*4.

One or more field names, specified as character*(*).

Field names must be valid MATLAB® identifiers, which means they cannot be empty. Field names are case-sensitive. To determine the maximum length of a field name, use the namelengthmax function.

Pointer to an mxArray, specified as mwPointer, if successful.

The function is unsuccessful when there is not enough free heap space to create the mxArray.

  • MEX file — Function terminates the MEX file and returns control to the MATLAB prompt.

  • Standalone (non-MEX file) application — Function returns 0.

Version History

Introduced before R2006a