4.0.0
A major overhaul of matlabcontrol, it includes the following:
- Dramatically improved reliability, with a complete rewrite of the MATLAB interaction logic
- Transparent unification of control from inside MATLAB and outside MATLAB
- Unconditionally thread-safe
- Highly configurable MATLAB settings, including running hidden
- Ability to reconnect to a previously controlled session
- Can disconnect from a MATLAB session without exiting MATLAB
- Detailed documentation which includes how types are converted between MATLAB and Java
- Numeric array conversion between MATLAB and Java arrays
- Non-interference with any other Remote Method Invocation uses in the application (when running outside MATLAB)
- Transfer non-JRE classes between MATLAB and the Java application (when running outside MATLAB)
- Fixes bugs preventing a Java application from terminating properly (when running outside MATLAB)
For those coming from v3, here are some important changes to note:
- There is no longer a distinction between local and remote control class-wise. There are times when the phrases running inside MATLAB and running outside MATLAB are used. Running inside MATLAB refers to what was previously called local control, while running outside MATLAB refers to what was previous called remote control. In all cases,
MatlabProxy
is the class which communicates with MATLAB, although in this version there are a number of classes which can wrap around a proxy. - Many of
MatlabProxy
's core methods have changed their signatures.getVariable(...)
,setVariable(...)
,eval(...)
, andexit()
remain the same.feval(...)
andreturningFeval(...)
now take in their function arguments using varargs which makes it easy to call a MATLAB function with any number of arguments.returningEval(...)
andreturningFeval(...)
now returnObject[]
with the length of the array equal to the number of arguments to be returned. The overloaded version ofreturningFeval(...)
that did not require specifying the number of return arguments has been removed. Additionally,setEchoEval(...)
has been removed. - A
MatlabProxyFactory
can still have the location of MATLAB and the proxy creation timeout specified but it is instead done using an instance ofMatlabProxyFactoryOptions
. The default timeout for getting a proxy is now 180 seconds which is increased from the previous 60 second timeout. - When running inside MATLAB, a
MatlabProxy
may not be called from the Event Dispatch Thread (EDT) used by AWT and Swing. While previous versions allowed this, it often lead to MATLAB locking up. A proxy may be used indirectly on the EDT by using aCallbackMatlabProxy
. MatlabConnectionListener
no longer exists. When requesting a proxy via the factory'srequestProxy(...)
method you provide a callback. Each proxy instance can haveDisconnectionListener
s added.- Requesting a proxy via
requestProxy(...)
now returns aRequest
object instead of the proxy's identifier. The identifier can be retrieved from the request. A proxy's identifier is no longer aString
, it is now anIdentifier
. - There is nothing like the deprecated
RemoteMatlabProxyController
.