Execute MATLAB command in Automation server
BSTR Execute([in] BSTR command)
Execute(command As String) As String
result = Execute(h,'command')
The Execute
function executes the MATLAB® statement
specified by command
in the MATLAB Automation
server attached to handle h
.
The server returns output from the command in result
. result
also
contains any MATLAB warning or error messages.
If you terminate the MATLAB command with a semicolon and
there are no warnings or error messages, result
might
be empty.
COM functions are available on Microsoft® Windows® systems only.
Create a 6-by-6 matrix in the MATLAB server, remove rows 4–6, and return the results to the client.
Dim Matlab As Object Dim server_version As String Matlab = CreateObject("matlab.application") MatLab.PutWorkspaceData("A","base",rand(6)) Matlab.Execute("A(4:6,:) = [];") Matlab.GetWorkspaceData("A","base",B)