matlab mxarraytostring函数语法

发表matlab mxarraytostring函数相关文章
一句话说明: Array to string

mxArrayToString (C)

Array to string

C Syntax

#include "matrix.h"
char *mxArrayToString(const mxArray *array_ptr);



Pointer to a string mxArray; that is, a pointer to an mxArray having the mxCHAR_CLASS class.


C-style string. Returns NULL on failure. Possible reasons for failure include out of memory and specifying an mxArray that is not a string mxArray.


Call mxArrayToString to copy the character data of a string mxArray into a C-style string. The C-style string is always terminated with a NULL character.

If the string array contains several rows, they are copied, one column at a time, into one long string array. This function is similar to mxGetString, except that

  • It does not require the length of the string as an input.

  • It supports multibyte encoded characters.

mxArrayToString does not free the dynamic memory that the char pointer points to. Consequently, you should typically free the string (using mxFree) immediately after you have finished using it.


See the following examples in matlabroot/extern/examples/mex.

See the following examples in matlabroot/extern/examples/mx.

See Also

mxCreateCharArray, mxCreateCharMatrixFromStrings, mxCreateString, mxGetString


与matlab mxarraytostring用法相关的文章

友情链接It题库(| 版权归yishouce.com所有| 友链等可联系|粤ICP备16001685号-1