| MATLAB® | ![]() |
#include "matrix.h" mxArray *mxCreateString(const char *str);
mwPointer mxCreateString(str) character*(*) str
The string that is to serve as the mxArray's initial data
A pointer to the created string mxArray if successful, and NULL in C (0 in Fortran) otherwise. The most likely cause of failure is insufficient free heap space.
Use mxCreateString to create a string mxArray initialized to str. Many MATLAB functions (for example, strcmp and upper) require string array inputs.
Free the string mxArray when you are finished using it. To free a string mxArray, call mxDestroyArray.
See revord.c in the refbook subdirectory of the examples directory.
For additional examples, see mxcreatestructarray.c and mxisclass.c in the mx subdirectory of the examples directory.
See matdemo1.F in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to use this routine in a Fortran program.
mxCreateCharMatrixFromStrings, mxCreateCharArray
![]() | mxCreateSparseLogicalMatrix (C) | mxCreateStructArray (C and Fortran) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |