| External Interfaces Reference | ![]() |
Create unpopulated N-dimensional string mxArray
C Syntax
Arguments
ndim
The desired number of dimensions in the string mxArray. You must specify a positive number. If you specify 0, 1, or 2, mxCreateCharArray creates a two-dimensional mxArray.
dims
The dimensions array. Each element in the dimensions array contains the size of the array in that dimension. For example, setting 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 string mxArray, 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
Call mxCreateCharArray to create an unpopulated N-dimensional string mxArray.
Any trailing singleton dimensions specified in the dims argument are automatically removed from the resulting array. For example, if ndim equals 5 and dims equals [4 1 7 1 1], the resulting array is given the dimensions 4-by-1-by-7.
Examples
See mxcreatecharmatrixfromstr.c in the mx subdirectory of the examples directory.
See Also
mxCreateCharMatrixFromStrings, mxCreateString
| mxCreateCellMatrix | mxCreateCharMatrixFromStrings | ![]() |
© 1994-2005 The MathWorks, Inc.