| MATLAB Function Reference | ![]() |
state = enableservice('AutomationServer',enable)
state = enableservice('AutomationServer')
state = enableservice('AutomationServer',enable) enables or disables the MATLAB® Automation server.
If enable is logical 1 (true), enableservice converts an existing MATLAB session into an Automation server. If enable is logical 0 (false), enableservice disables the MATLAB Automation server.
state indicates the previous state of the Automation server. If state = 1, MATLAB was an Automation server. If state is logical 0 (false), MATLAB was not an Automation server.
state = enableservice('AutomationServer') returns the current state of the Automation server. If state is logical 1 (true), MATLAB is an Automation server.
Enable the Automation server in the current MATLAB session:
state = enableservice('AutomationServer',true);Next, show the current state of the MATLAB session:
state = enableservice('AutomationServer')
MATLAB displays state = 1 (true), showing that MATLAB is an Automation server.
Finally, enable the Automation server and show the previous state by typing
state = enableservice('AutomationServer',true)
MATLAB displays state = 1 (true), showing that MATLAB previously was an Automation server.
Note the previous state may be the same as the current state. As seen in this case, state = 1 shows MATLAB was, and still is, an Automation server.
![]() | elseif | end | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |