public final class LinkedOperations extends Object implements MatlabOperations
| Constructor and Description |
|---|
LinkedOperations(MatlabProxy proxy) |
| Modifier and Type | Method and Description |
|---|---|
void |
eval(String command)
Evaluates a command in MATLAB.
|
void |
feval(String functionName,
Object... args)
Calls a MATLAB function with the name
functionName, returning the result. |
MatlabProxy |
getDelegateProxy()
The proxy used to communicate with MATLAB.
|
Object |
getVariable(String variableName)
Gets the value of
variableName in MATLAB. |
Object[] |
returningEval(String command,
int nargout)
Evaluates a command in MATLAB, returning the result.
|
Object[] |
returningFeval(String functionName,
int nargout,
Object... args)
Calls a MATLAB function with the name
functionName, returning the result. |
void |
setVariable(String variableName,
Object value)
Sets
variableName to value in MATLAB, creating the variable if it does not yet exist. |
public LinkedOperations(MatlabProxy proxy)
public void eval(String command) throws MatlabInvocationException
MatlabOperationseval('command').eval in interface MatlabOperationscommand - the command to be evaluated in MATLABMatlabInvocationExceptionpublic Object[] returningEval(String command, int nargout) throws MatlabInvocationException
MatlabOperationseval('command').
nargout. This is equivalent in MATLAB to the number of variables placed on the left hand side of an
expression. For example, in MATLAB the inmem function may be used with either 1, 2, or 3 return values
each resulting in a different behavior:
M = inmem;
[M, X] = inmem;
[M, X, J] = inmem;
The returned Object array will be of length nargout with each return argument placed into the
corresponding array position.
nargout then an exception will be
thrown.returningEval in interface MatlabOperationscommand - the command to be evaluated in MATLABnargout - the number of arguments that will be returned from evaluating commandnargoutMatlabInvocationExceptionpublic void feval(String functionName, Object... args) throws MatlabInvocationException
MatlabOperationsfunctionName, returning the result. Arguments to the function may
be provided as args, but are not required if the function needs no arguments.
String will be converted to a MATLAB char array, not a variable name.feval in interface MatlabOperationsfunctionName - the name of the MATLAB function to callargs - the arguments to the functionMatlabInvocationExceptionpublic Object[] returningFeval(String functionName, int nargout, Object... args) throws MatlabInvocationException
MatlabOperationsfunctionName, returning the result. Arguments to the function may
be provided as args, but are not required if the function needs no arguments.
String will be converted to a MATLAB char array, not a variable name.
nargout. This is equivalent in MATLAB to the number of variables placed on the left hand side of an
expression. For example, in MATLAB the inmem function may be used with either 1, 2, or 3 return values
each resulting in a different behavior:
M = inmem;
[M, X] = inmem;
[M, X, J] = inmem;
The returned Object array will be of length nargout with each return argument placed into the
corresponding array position.
nargout then an
exception will be thrown.returningFeval in interface MatlabOperationsfunctionName - the name of the MATLAB function to callnargout - the number of arguments that will be returned by functionNameargs - the arguments to the functionnargoutMatlabInvocationExceptionpublic void setVariable(String variableName, Object value) throws MatlabInvocationException
MatlabOperationsvariableName to value in MATLAB, creating the variable if it does not yet exist.setVariable in interface MatlabOperationsMatlabInvocationExceptionpublic Object getVariable(String variableName) throws MatlabInvocationException
MatlabOperationsvariableName in MATLAB.getVariable in interface MatlabOperationsMatlabInvocationExceptionpublic MatlabProxy getDelegateProxy()