Set the name of an mxArray
C Syntax
#include "matrix.h"
void mxSetName(mxArray *array_ptr, const char *name);
Arguments
array_ptr
Pointer to an mxArray.
name
The name you are assigning to the mxArray. The specified name can be up to mxMAXNAM characters, where mxMAXNAM is a constant defined in the matrix.h header file. If you specify a name longer than mxMAXNAM-1 characters, then mxSetName assigns only the first mxMAXNAM-1 characters to the name.
Description
Call mxSetName to establish a name for an mxArray or to change an existing name.
mxSetName assigns the characters in name to a fixed-width section of memory. Do not deallocate this memory.
Examples
Create an mxArray. Then, give it a name.
mxArray *array_ptr;
/* Create a 5-by-7 real array. */
array_ptr = mxCreateDoubleMatrix(5, 7, mxREAL);
/* Name the array "Grapes" */
mxSetName(array_ptr, "Grapes");
...
For an additional example, see mxsetname.c in the mx subdirectory of the examples directory.
See Also
mxGetName
[ Previous | Help Desk | Next ]