1

Matlab has generally great documentation about its interface with external programming languages such as C/C++ and Fortran.

But, as counter-part, there is a really poor documentation about Matlab's interface with Java: from a few threads I've been reading, Matlab is internally quite massively using Java, but then no real available documentation on how to further improve Matlab capabilities by means of Java methods or whatever.

Would you mind to provide me with some more reliable and solid evidence?

Andrew Janke
  • 23,508
  • 5
  • 56
  • 85
fpe
  • 2,700
  • 2
  • 23
  • 47

2 Answers2

3

There is a section in the documentation dedicated to working with Java:

Using Java Libraries in MATLAB

It explains in good details all the Java features available in MATLAB.

Once you are comfortable with the basics, make sure to check out Yair Altman's blog as others have suggested. You'll find numerous MATLAB-Java integration articles, often covering undocumented features.

Amro
  • 123,847
  • 25
  • 243
  • 454
2

MATLAB has reasonable support for interacting with Java from MATLAB code. Unfortunately, there is no official support for interacting with MATLAB code from Java. Internally, MATLAB frequently calls Java code from MATLAB code by making use of a private Java MATLAB Interface (JMI) which exists as a jmi.jar in the bowels of MATLAB.

Using jmi.jar directly is rather problematic and of course entirely undocumented. Instead, you can use matlabcontrol which is a Java API which will allow you to call MATLAB from Java. It's a well documented and reliable wrapper around JMI. You can either call MATLAB from within MATLAB or from outside MATLAB in which case an instance of MATLAB is launched and connected to. It allows for invoking eval and feval in MATLAB and returning the results to MATLAB. The walkthrough explains with examples how to do this.

Joshua Kaplan
  • 843
  • 5
  • 9