Apama 10.15.0 | Developing Apama Applications | Developing Apama Applications in EPL | Using EPL Plug-ins | Using MATLAB® products in an application | MatlabManager actions
 
MatlabManager actions
The MatlabManager event provides the following actions. For complete reference information, see the API Reference for EPL (ApamaDoc) .
Action
Description
openSession(
string sessionID,
string messageID,
boolean singleUse,
integer precision,
action<string, string,
boolean, string>
callback)
Starts a MATLAB process for the purpose of using MATLAB as a computational engine. Uses the MATLAB API function engOpen() if singleUse is false and engOpenSingleUse() if singleUse is true. Single use is unavailable on Linux. The response to this action call is an OpenSessionResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
closeSession(
string sessionID,
string messageID,
action<string, string,
boolean, string>
callback)
Closes a MATLAB session. Uses the MATLAB API function engClose(). The response to this action call is a CloseSessionResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
initialize()
You must call this action when you are using MATLAB by means of routed events in a context other than the main context. Spawn to another context, set up the relevant listeners in the new context, and then call initialize(). You do not need to call initialize() when you are calling the MatlabManager actions.
putFloat(
string sessionID,
striing messageID,
string name,
float value,
action <string, string,
boolean, string>
callback)
Puts a float variable into a MATLAB engine workspace. Uses the MATLAB API function engPutVariable(). The response to this action call is a PutFloatResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
Note: 
By default, this event creates a local variable in the MATLAB session. If you need the variable to have a global scope, call evaluate() before you call the putFloat() action. In the evaluate() call, declare the variable as being global (for example, "global x").
getFloat(
string sessionID,
string messageID,
string name,
action<string, string,
float, boolean, string>
callback)
Gets a float variable from the MATLAB engine workspace. Uses the MATLAB API function engGetVariable(). The response to this action call is a GetFloatResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
putFloatSequence(
string sessionID,
string messageID,
string name,
sequence<float> values,
action<string, string,
boolean, string>
callback)
Puts a float sequence variable in a MATLAB engine workspace. Uses the MATLAB API function engPutVariable(). The response to this action call is a PutFloatSequenceResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
getFloatSequence(
string sessionID,
string messageID,
string name,
action<string, string,
sequence<float>, boolean,
string>
callback)
Gets a float sequence variable from the MATLAB engine workspace. Uses the MATLAB API function engGetVariable(). The response to this action call is a GetFloatSequenceResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
putFloatMatrix(
string sessionID,
string messageID,
string name,
sequence<sequence<float>> values,
action<string, string,
boolean, string>
callback)
Puts a two-dimensional matrix variable into a MATLAB engine workspace. Uses the MATLAB API function engEval(). The response to this action call is a PutFloatMatrixResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
getFloatMatrix(
string sessionID,
string messageID,
string name,
action<string, string,
sequence<sequence<float>>,
boolean, string>
callback)
Gets a two-dimensional matrix variable from the MATLAB engine workspace. Uses the MATLAB API function engGetVariable(). The response to this action call is a GetFloatMatrixResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
evaluate (
string sessionID,
string messageID,
string expression,
integer outputSize,
action<string, string,
string, sequence<string>
boolean, string>
callback)
Evaluates an expression for the MATLAB engine session and returns textual output from evaluating the expression, including possible error messages. Uses the MATLAB API function engEvalString(). The response to this action call is an EvaluateResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
setVisible(
string sessionID,
string messageID,
boolean value,
action<string, string,
boolean, string>
callback)
Makes the window for the MATLAB engine session either visible or invisible on the Windows desktop. Uses the MATLAB API function engSetVisible(). The response to this action call is a SetVisibleResponse event routed from the plug-in to the calling context and the supplied callback is invoked.
getVisible(
string sessionID,
string messageId,
action<string, boolean,
boolean, string>
callback)
Returns the current visibility setting for the MATLAB engine session. Uses the MATLAB API function engGetVisible(). The response to this action call is a GetVisibleResponse event routed from the plug-in to the calling context and the supplied callback is invoked.