MATLAB Application Program Interface Reference Help Desk

mxCreateStructMatrix

Purpose

Create an unpopulated 2-dimensional structure mxArray

C Syntax

Arguments

m

The desired number of rows. This must be a positive integer.

n

The desired number of columns. This must be a positive integer.

nfields

The desired number of fields in each element.

field_names

The desired list of field names.

Returns

A pointer to the created structure mxArray, if successful; otherwise, returns NULL. The most likely cause of failure is insufficient heap space to hold the returned mxArray.

Description

mxCreateStructMatrix and mxCreateStructArray are almost identical. The only difference is that mxCreateStructMatrix can only create two-dimensional mxArrays, while mxCreateStructArray can create mxArrays having two or more dimensions.

Examples

Create a two-dimensional structure mxArray having the dimensions 5-by-7:

The created structure mxArray is unpopulated. See the mxCreateStructArray reference page for sample code demonstrating how to populate a structure mxArray. For an additional example of mxCreateStructMatrix, see mxCreateStructMatrix.c in the mx subdirectory of the examples directory.

See Also

mxCreateStructArray



[ Previous | Help Desk | Next ]