I'm compiling some MATLAB functions into a C DLL. The exported mlf functions return a boolean value representing whether the function succeeded or not. When the return value is false, I want to find out the error information. I couldn't find a way to do that! (other than compiling and exporting the lasterror() function).

Is there a C interface to get the last error generated by MATLAB's runtime?


Okay, let's try...

mexCallMATLABWithTrap (C and Fortran) - Call MATLAB function, user-defined M-file, or MEX-file and capture error information

#include "mex.h"

mxArray *mexCallMATLABWithTrap(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[], const char *functionName);


mexEvalStringWithTrap (C and Fortran) - Execute MATLAB command in caller's workspace and capture error information

#include "mex.h"

mxArray *mexEvalStringWithTrap(const char *command);

Those two things were found with Google and a guess or two. Sorry if it's a waste of time.

Need Your Help

Bash regex to detect IPv6 or none

regex bash ipv6

How would I modify this IPv6 regex I wrote to either detect the address (ie the way the regex is written right now), but also accept "blank" ie the user did not specify an IPv6 address?

Is Django middleware thread safe?

python django thread-safety middleware

Are Django middleware thread safe? Can I do something like this,