Be aware of the behavior when calling back into MATLAB® using
mexCallMATLAB with an
async request like
mexCallMATLAB function is synchronous. After it launches a function using the call to
fevalAsync, the MEX function continues to the end, returns to MATLAB, and is then unloaded. If the
async processing of the requested
feval command tries to reference the MEX function, it generates an exception.
Consider using the
mexUnLock functions to ensure that the MEX function stays in memory while the
async function processes.