0

I'm calling a jar file from Matlab using the system function. Like this:

system('java -jar myfile.jar') 

When I run the jar file directly through CLI it runs like a charm in less than 1min.

When I call it from Matlab using the system function, however, it takes around 10min to run!

Any ideas on how to solve this, or the cause of the slowness?

Nick Volynkin
  • 14,023
  • 6
  • 43
  • 67
Dr. No
  • 156
  • 1
  • 7
  • 1
    Maybe this from stackoverflow can help you: http://stackoverflow.com/questions/1693429/is-matlab-oop-slow-or-am-i-doing-something-wrong – JFPicard Jun 09 '15 at 19:28
  • Tks, but i'm not calling a java function within matlab... I'm just calling the jar with the system command, like this: system('java -jar myfile.jar') This call is taking 10x more than execution from CLI. – Dr. No Jun 09 '15 at 19:31
  • Is there much console output? If so try to pipe it to null. Forwarding this output to the matlab command prompt might be slow. – Daniel Jun 09 '15 at 20:22
  • You could still try to call the Java functions in the jar directly from Matlab. It might be faster. See `javaaddpath`. – A. Donda Jun 10 '15 at 00:50
  • Did you try it with `!java -jar myfile.jar` ? – Dev-iL Jun 16 '15 at 18:33

0 Answers0