Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

Execute - Execute MATLAB command in Automation server

Synopsis

MATLAB Client

result = h.Execute('command')
result = Execute(h, 'command')
result = invoke(h, 'Execute', 'command')

IDL Method Signature

BSTR Execute([in] BSTR command)

Microsoft Visual Basic Client

Execute(command As String) As String

Description

The Execute function executes the MATLAB statement specified by the string command in the MATLAB Automation server attached to handle h.

The server returns output from the command in the string, result. The result string also contains any warning or error messages that might have been issued by MATLAB software as a result of the command.

Note that if you terminate the MATLAB command string with a semicolon and there are no warnings or error messages, result might be returned empty.

Remarks

If you want to be able to display output from Execute in the client window, you must specify an output variable (i.e., result in the above syntax statements).

Server function names, like Execute, are case sensitive when used with dot notation (the first syntax shown).

All three versions of the MATLAB client syntax perform the same operation.

COM functions are available on Microsoft Windows systems only.

Examples

Execute the MATLAB version function in the server and return the output to the MATLAB client.

MATLAB Client

h = actxserver('matlab.application');
server_version = h.Execute('version')
server_version =
ans =
   6.5.0.180913a (R13)

Visual Basic .NET Client

Dim Matlab As Object
Dim server_version As String
Matlab = CreateObject("matlab.application")
server_version = Matlab.Execute("version")

See Also

Feval, PutFullMatrix, GetFullMatrix, PutCharArray, GetCharArray

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS