public interface MatlabInternalProxy
extends java.rmi.Remote
checkConnection()
. All of these
methods throw RemoteException. RemoteException will be thrown if something occurs to disrupt the
communication between this JVM and the one MATLAB is running in. For instance, closing MATLAB
will terminate its JVM and then all method calls on this proxy will throw exceptions.
Additionally, many of these methods throw InterruptedException. This occurs if while waiting for
MATLAB to return from a method called on it, the thread waiting is interrupted. For descriptions
of what these methods do see the corresponding methods in RemoteMatlabProxy
.Modifier and Type | Method and Description |
---|---|
void |
checkConnection()
This method does nothing.
|
java.lang.String |
eval(java.lang.String command)
Evaluates a command in MATLAB.
|
void |
exit()
Exits MATLAB.
|
void |
feval(java.lang.String command,
java.lang.Object[] args)
Calls a MATLAB function with the name
functionName . |
java.lang.Object |
getVariable(java.lang.String variableName)
Gets the value of the variable named variableName from MATLAB.
|
java.lang.Object |
returningEval(java.lang.String command,
int returnCount)
Evaluates a command in MATLAB.
|
java.lang.Object |
returningFeval(java.lang.String command,
java.lang.Object[] args)
Calls a MATLAB function with the name
functionName . |
java.lang.Object |
returningFeval(java.lang.String command,
java.lang.Object[] args,
int returnCount)
Calls a MATLAB function with the name
functionName . |
void |
setEchoEval(boolean echo)
Allows for enabling a diagnostic mode that will show in MATLAB each time a Java method that
calls into MATLAB is invoked.
|
void |
setVariable(java.lang.String variableName,
java.lang.Object value)
Sets the variable to the given
value . |
void exit() throws java.rmi.RemoteException, MatlabInvocationException
java.rmi.RemoteException
MatlabInvocationException
void setVariable(java.lang.String variableName, java.lang.Object value) throws java.rmi.RemoteException, MatlabInvocationException
value
.variableName
- value
- java.rmi.RemoteException
MatlabInvocationException
java.lang.Object getVariable(java.lang.String variableName) throws java.rmi.RemoteException, MatlabInvocationException
variableName
- java.rmi.RemoteException
MatlabInvocationException
java.lang.String eval(java.lang.String command) throws java.rmi.RemoteException, MatlabInvocationException
eval(['command'])
.command
- the command to be evaluated in MATLABjava.rmi.RemoteException
MatlabInvocationException
returningEval(String, int)
void feval(java.lang.String command, java.lang.Object[] args) throws java.rmi.RemoteException, MatlabInvocationException
functionName
. Arguments to the function
may be provided as args
, if you wish to call the function with no arguments pass
in null
. The result of this command will not be returned. Object
s in the array will be converted into MATLAB equivalents as
appropriate. Importantly, this means that any String
will be converted to a
MATLAB char array, not a variable name.command
- name of the MATLAB function to callargs
- the arguments to the function, null
if nonejava.rmi.RemoteException
MatlabInvocationException
returningFeval(String, Object[], int)
,
returningFeval(String, Object[])
java.lang.Object returningFeval(java.lang.String command, java.lang.Object[] args) throws java.rmi.RemoteException, MatlabInvocationException
functionName
. Arguments to the function
may be provided as args
, if you wish to call the function with no arguments pass
in null
. Object
s in the array will be converted into MATLAB equivalents as
appropriate. Importantly, this means that any String
will be converted to a
MATLAB char array, not a variable name. returningFeval(String, Object[], int)
and specify the number of arguments that
will be returned.command
- name of the MATLAB function to callargs
- the arguments to the function, null
if nonejava.rmi.RemoteException
MatlabInvocationException
feval(String, Object[])
,
returningFeval(String, Object[])
java.lang.Object returningFeval(java.lang.String command, java.lang.Object[] args, int returnCount) throws java.rmi.RemoteException, MatlabInvocationException
functionName
. Arguments to the function
may be provided as args
, if you wish to call the function with no arguments pass
in null
. Object
s in the array will be converted into MATLAB equivalents as
appropriate. Importantly, this means that any String
will be converted to a
MATLAB char array, not a variable name. returnCount
. You can use the nargout
function in the MATLAB Command Window to determine the
number of arguments that will be returned. If nargout
returns -1 that means the
function returns a variable number of arguments based on what you pass in. In that case, you
will need to manually determine the number of arguments returned. If the number of arguments
returned differs from returnCount
then either only some of the items will be
returned or null
will be returned.command
- name of the MATLAB function to callargs
- the arguments to the function, null
if nonereturnCount
- the number of arguments that will be returned from this functionjava.rmi.RemoteException
MatlabInvocationException
feval(String, Object[])
,
returningFeval(String, Object[])
java.lang.Object returningEval(java.lang.String command, int returnCount) throws java.rmi.RemoteException, MatlabInvocationException
eval(['command'])
. returnCount
. If the command you are evaluating is a MATLAB
function you can determine the amount of arguments it returns by using the
nargout
function in the MATLAB Command Window. If it returns -1 that means the
function returns a variable number of arguments based on what you pass in. In that case, you
will need to manually determine the number of arguments returned. If the number of arguments
returned differs from returnCount
then either null
or an empty
String
will be returned.command
- the command to be evaluated in MATLABreturnCount
- the number of arguments that will be returned from evaluating the commandjava.rmi.RemoteException
MatlabInvocationException
eval(String)
void setEchoEval(boolean echo) throws java.rmi.RemoteException
echo
- java.rmi.RemoteException
void checkConnection() throws java.rmi.RemoteException
java.rmi.RemoteException