| MATLAB Application Program Interface | Search  Help Desk |
| mxGetString | See Also |
Create a character array from an mxArray
integer*4 function mxGetString(pm, str, strlen) integer*4 pm, strlen character*(*) strpm
mxArray.
str
character array.
strlen
mxArray.
The character array, on success. Returns 0 otherwise.
Call mxGetString to copy a character array from an mxArray. mxGetString copies and converts the character array from the mxArray pm into the character array str. Storage space for character array str must be allocated previously.
Only up to strlen characters are copied, so ordinarily, strlen is set to the dimension of the character array to prevent writing past the end of the array. Check the length of the character array in advance using mxGetM and mxGetN. If the character array contains several rows, they are copied, one column at a time, into one long character array.
mxCalloc