manpagez: man pages & more
info octave
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

A.2.3 Character Strings in Mex-Files

As mex-files do not make the distinction between single and double quoted strings within Octave, there is perhaps less complexity in the use of strings and character matrices in mex-files. An example of their use, that parallels the demo in ‘stringdemo.cc’, is given in the file ‘mystring.c’, as seen below.

An example of its expected output is

 
mystring(["First String"; "Second String"])
⇒ s1 = Second String
        First String

Other functions in the mex interface for handling character strings are mxCreateString, mxArrayToString, and mxCreateCharMatrixFromStrings. In a mex-file, a character string is considered to be a vector rather than a matrix. This is perhaps an arbitrary distinction as the data in the mxArray for the matrix is consecutive in any case.


© manpagez.com 2000-2017
Individual documents may contain additional copyright information.