External Interfaces/API    

MATLAB COM Automation Methods

This section lists the methods that are supported by the MATLAB Automation Server. The data types for the arguments and return values are expressed as Automation data types, which are language-independent types defined by the Automation protocol. For example, BSTR is a wide-character string type defined as an Automation type, and is the same data format used by Visual Basic to store strings. Any COM-compliant controller should support these data types, although the details of how you declare and manipulate these are controller specific.

BSTR Execute([in] BSTR Command);

This command accepts a single string (Command), which contains any command that can be typed at the MATLAB command window prompt. MATLAB will execute the command and return the results as a string. Any figure windows generated by the command are displayed on the screen as if the command were executed directly from the command window or an M-file. A Visual Basic example is

This method retrieves a full, one- or two-dimensional real or imaginary mxArray from the named workspace. The real and (optional) imaginary parts are retrieved into separate arrays of doubles.

Name.   Identifies the name of the mxArray to be retrieved.

Workspace.   Identifies the workspace that contains the mxArray. Use the workspace name "base" to retrieve an mxArray from the default MATLAB workspace. Use the workspace name "global" to put the mxArray into the global MATLAB workspace. The "caller" workspace does not have any context in the API when used outside of MEX-files.

pr.   Array of reals that is dimensioned to be the same size as the mxArray being retrieved. On return, this array will contain the real values of the mxArray.

pi.   Array of reals that is dimensioned to be the same size as the mxArray being retrieved. On return, this array will contain the imaginary values of the mxArray. If the requested mxArray is not complex, an empty array must be passed. In Visual Basic, an empty array is declared as
Dim Mempty() as Double. A Visual Basic example of this method is

This method puts a full, one- or two-dimensional real or imaginary mxArray into the named workspace. The real and (optional) imaginary parts are passed in through separate arrays of doubles.

Name.   Identifies the name of the mxArray to be placed.

Workspace.   Identifies the workspace into which the mxArray should be placed. Use the workspace name "base" to put the mxArray into the default MATLAB workspace. Use the workspace name "global" to put the mxArray into the global MATLAB workspace. The "caller" workspace does not have any context in the API when used outside of MEX-files.

pr.   Array of reals that contains the real values for the mxArray.

pi.   Array of reals that contains the imaginary values for the mxArray. If the mxArray that is being sent is not complex, an empty array must be passed for this parameter. In Visual Basic, an empty array is declared as Dim Mempty() as Double. A Visual Basic example of this method is


  MATLAB Automation Server Support MATLAB Automation Properties