JMIWrapper¶
-
class
JMIWrapper¶ Interacts with MATLAB via the undocumented Java MATLAB Interface (JMI). This code is inspired by Kamin Whitehouse‘s MatlabControl. Fixes to concurrency bugs in this class have been aided by the feedback of several matlabcontrol users, thank you for your feedback! This class runs inside of MATLAB’s Java Virtual Machine and relies upon the Java MATLAB Interface which is distributed by MathWorks as
jmi.jar. It allows for Java to sendevalandfevalstatements to MATLAB and receive results.jmi.jaris not distributed with matlabcontrol as it is the property of MathWorks. If you wish to compile the source code you will need to reference the version ofjmi.jarthat is distributed with your copy of MATLAB. It is located atmatlabroot/java/jar/jmi.jarwherematlabrootis the location of your MATLAB installation. The location ofmatlabrootcan be determined by executing thematlabrootcommand in the MATLAB Command Window. This is the only class in matlabcontrol which directly links against code injmi.jar. (And therefore also the only class that needsjmi.jarto be on the classpath in order to compile.)Configurationalso uses code injmi.jarbut uses reflection to interact with it.Author: Joshua Kaplan
Methods¶
exit¶
-
static void
exit()¶ Exits MATLAB without waiting for MATLAB to return, because MATLAB will not return when exiting.
Throws:
invokeAndWait¶
-
static <T> T
invokeAndWait(MatlabThreadCallable<T> callable)¶ Invokes the
callableon the main MATLAB thread and waits for the computation to be completed.Parameters: - <T> –
- callable –
Throws: