2
votes

I am trying to run compiled MATLAB code (by mcc) from inside MATLAB in a way that I can avoid using another license that is required by the compiled code. We need this because we run this same specific code part again and again and execution is stuck due to license waiting. We don't want to buy tons of this specific license just to mass run the same part. Is there any way to do this? tutorial?

Is it possible to compile a .m file to dll/so and wrap it like a mex and call it from MATLAB on the fly? How would I pass and retrieve complex arguments?

2

2 Answers

0
votes

According to http://www.mathworks.de/products/compiler/description3.html creating shared libraries should well be possible.

Concerning passing and retrieving complex arguments: If you plan to use mex, I'd assume you should be able to call the shared-library "main"-function with any arguments you'd like, using the mxArray type that you'll have to use anyway.

0
votes

To run the MATLAB-compiled code in MATLAB, you want codegen, part of the MATLAB Coder. See this blog post on generating C code from MATLAB. The alternative, deploying code with mcc/mbuild and then reloading it into MATLAB with loadlibrary is rather contorted, and I wouldn't advice it.