| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "matrix.h" mxArray *mxCreateString(const char *str);
mwPointer mxCreateString(str) character*(*) str
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 matlabroot/extern/examples/refbook folder .
For additional examples, see mxcreatestructarray.c and mxisclass.c in the matlabroot/extern/examples/mx folder .
See matdemo1.F in the matlabroot/extern/examples/eng_mat folder for sample programs that illustrate how to use the MAT-file routines in a Fortran program.
mxCreateCharMatrixFromStrings, mxCreateCharArray
![]() | mxCreateSparseLogicalMatrix (C) | mxCreateStructArray (C and Fortran) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |