An asynchronous Java interface to MATLAB

MATLAB, an interactive environment for numerical and symbolic computation, supports a number of interfaces to foreign programming languages including Java. However, there is no appropriate support for calling back MATLAB functions from within the Java Virtual Machine integrated with MATLAB. This paper presents such an interface which is based exclusively on documented and portable mechanisms supplied by Java and MATLAB. Our approach is based on asynchronous communication between Java threads and MATLAB and follows the producer/consumer pattern. We also present performance measurements and discuss the impact of an optimization for calling MATLAB functions that return a result value back to Java.