title: Call a function by an external application without opening a new instance of Matlab
body: <p>Is there a way to call Matlab functions from outside, in particular by the Windows <code>cmd</code> (but also the Linux terminal, LUA-scripts, etc...), WITHOUT opening a new instance of Matlab each time? </p>
  
  <p>for example in <code>cmd</code>: </p>
  
  <pre><code>matlab -sd myCurrentDirectory -r "function(parameters)" -nodesktop -nosplash -nojvm
  </code></pre>
  
  <p>opens a new instance of Matlab relatively fast and executes my function. Opening and closing of this reduced matlab prompt takes about 2 seconds (without computations) - hence for 4000 executions more than 2 hours. I'd like to avoid this, as the called function is always located in the same workspace. Can it be done in the same instance always?</p>
  
  <p>I already did some research and found the possibility of the <a href="http://www.mathworks.de/de/help/matlab/call-matlab-com-automation-server.html" rel="noreferrer">MATLAB COM Automation Server</a>, but it seems quite complicated to me and I don't see the essential steps to make it work for my case. Any advices for that?</p>
  
  <p>I'm not familiar with <code>c/c++/c#</code> but I'm thinking about the use of <code>python</code> (but just in the worst case). </p>