| MATLAB Application Program Interface Reference | Help Desk |
mxSetName
Set the name of anmxArray
#include "matrix.h" void mxSetName(mxArray *array_ptr, const char *name);array_ptr 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.
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.
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.
mxGetName