External Interfaces/API |
MATLAB Automation Server Support
MATLAB on Microsoft Windows supports COM Automation server capabilities. Automation is a COM protocol that allows one application or component (the controller) to control another application or component (the server). Thus, MATLAB can be launched and controlled by any Windows program that can be an Automation Controller. Some examples of applications that can be Automation Controllers are Microsoft Excel, Microsoft Access, Microsoft Project, and many Visual Basic and Visual C++ programs. Using Automation, you can execute MATLAB commands, and get and put mxArrays
from and to the MATLAB workspace.
To use MATLAB as an Automation server, follow steps 1 and 2:
Matlab.Application
. Exactly how you invoke the MATLAB server depends on which controller you choose, but all controllers require this name to identify the server.Execute
method, and that works in Microsoft Excel or any other Visual Basic or Visual Basic for Applications (VBA)-enabled application. The Execute
method takes a command string as an argument and returns the results as a string. The command string can be any command that would normally be typed in the command window; the result contains any output that would have been printed to the command window as a result of executing the string, including errors:
Note The first statement above should be declared in the general declarations section in order to keep the scope throughout the application. |
Using MATLAB as a DCOM Server Client | MATLAB COM Automation Methods |