JMatlab/Link is a new engine communications scheme that is superior to the previous Matlab engine. It can be used to create stand-alone Java applications that use the full power of Matlab for number crunching and graphics. For development the following software is required:

  • Matlab version 7
  • Matlab Compiler version 4
  • Microsoft Visual C++ compiler
With these tools it is possible to generate stand-alone dlls from typical Matlab .m files easily with a single command, for example:

mcc -B cpplib:matlabtest darraytest.m inttest.m graphtest.m

Using JMatlab/Link together with the generated dlls has the following benefits:

  • works with Matlab Compiler version 4 (R14SP1 and upwards)
  • full support for Matlab graphics, they will appear in the usual figure windows with all features, for example rotating for 3D graphs and various export options
  • allows full control over Matlab execution, especially stopping a running computation any time
  • reports all Matlab output and errors to a logging handler (default or user supplied)
  • even if a Matlab computation results in a fatal error, the Java application will remain stable and can safely invoke other computation based on Matlab
  • allows for a single installation procedure of applications using it without the need to install the Matlab Component Runtime in a separate step
  • allows for seamless and easy interaction between Java and Matlab, combining the strengths of both

Using JMatlab/Link

All that is required to use JMatlab/Link are two small native libraries that must reside in the jmatlab subdirectory of your applications root path, together with jstatcom.jar in the classpath. Java developers just use the class com.jstatcom.engine.matlab.JMatlab to load Matlab generated dlls and call their procedures. No interaction with native code is required, nor any configuration changes.