| MATLAB Application Program Interface | Search  Help Desk |
| mxCreateCharArray | Examples See Also |
Create an unpopulated N-dimensional string mxArray
C Syntax
#include "matrix.h" mxArray *mxCreateCharArray(int ndim, const int *dims);
Arguments
ndimmxArray. You must specify a positive number. If you specify 0, 1, or 2, mxCreateCharArray creates a two-dimensional mxArray.
dims
dims[0] to 5 and dims[1] to 7 establishes a 5-by-7 mxArray. The dims array must have at least ndim elements.
Returns
A pointer to the created stringmxArray, if successful. If unsuccessful in a stand-alone (nonMEX-file) application, mxCreateCharArray returns NULL. If unsuccessful in a MEX-file, the MEX-file terminates and control returns to the MATLAB prompt. Insufficient free heap space is the only reason for mxCreateCharArray to be unsuccessful.
Description
CallmxCreateCharArray to create an unpopulated N-dimensional string mxArray.
Example
Seemxcreatecharmatrixfromstr.c in the mx subdirectory of the examples directory.
See Also
mxCreateCharMatrixFromStrings, mxCreateString