user3101650
user3101650

Reputation: 25

how to call a matlab function with arguments and capture output in java?

I would like to know how to call and execute a matlab function with parameters using java and capture the output in java.

Upvotes: 2

Views: 156

Answers (1)

Daniel
Daniel

Reputation: 36710

I see different options.

  1. Create a JAR from your code, using the Builder JA.
  2. Use matlabcontrol, which is a 3rd party automation server:
  3. Use the MatlabControl.java, which allows to run matlab code from java running within the matlab JRE. enter link description here
  4. While the Builder JA is expensive and the options 2 and 3 might get you in truble with future matlab versions, using the matlab CLI is another possibility which probably does not cause any maintenance. For parameters and return, I would use a file. The main disadvantage is a new matlab session starting for each call, which needs some time.

Upvotes: 2

Related Questions