External Interfaces/API Reference    
mxGetName

Get the name of the specified mxArray

C Syntax

Arguments
array_ptr
   Pointer to an mxArray.

Returns

A pointer to the start of the name field. If the mxArray has no name, the first element in the name field is \0.

Description

Use mxGetName to determine the name of the mxArray that array_ptr points to.

The returned name is a NULL-terminated character string. MATLAB variable names are stored in fixed-length character arrays of length mxMAXNAM+1, where mxMAXNAM is defined in the file mxArray.h. Thus variable names can by any length up to mxMAXNAM. The actual length is determined by the NULL terminator.

mxGetName passes back a pointer to an existing section of memory; therefore, your application should not allocate space to hold the returned name string. Do not attempt to deallocate or free the returned string.

Examples

See matdgns.c in the eng_mat subdirectory of the examples directory. For an additional example, see explore.c in the mex subdirectory of the examples directory.

See Also

mxSetName


 mxGetN mxGetNaN