I would like to pass a string vector from C ++ to matlab. I tried using available functions like mxCreateCharMatrixFromStrings, but this does not give me the correct behavior.
So, I have something like this:
void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
vector<string> stringVector;
stringVector.push_back("string 1");
stringVector.push_back("string 2");
The problem is how to get this vector in matlab?
plhs[0] = ???
My goal is to run:
>> [strings] = MyFunc(...)
>> strings(1) = 'string 1'
source
share