Hi! I'm writing a small C application that launchs a Matlab script (.m file). I need to exchange some variables and I don't know how to get an array of chars that exists in Matlab.
I'm doing something like this:
enter code here
result = engGetVariable(ep,"X");
if (!result)
{
printf ("Error...");
exit -1;
}
int n = mxGetN(result);
char *varx = NULL;
memcpy(varx, mxGetData(result),n*sizeof(char));
It doesn't work. Does someone know how to get a Matlab string in C? I've read Matlab documentation about engGetVariable() and the provided example but any of this things clarify me.