I have some MATLAB script, for example:
function mat_foo(varargin)
params.x = 'aaa';
params = parse_input(params, varargin);
disp(params.x);
end
parse_input is a function I have which convert data from varargin and override the defaults at 'params' struct.
I compiled this function and I want to call it from python, I do it the following way:
subprocess.check_call(['$/mat_foo.app/Contents/MacOS/applauncher x bbb'], shell=True)
This sets params.x to 'bbb' and works well.
My problem is that each time I want to call a compiled MATLAB it initializes the MCR and takes about 8-10 seconds. My question is if there is a way to initialize the MCR once and use it many times quickly? I use MATLAB R2013a and python 2.7.5 on OSX