Register, unregister, or query MATLAB COM server
comserver(
registers or unregisters
MATLAB® as a COM server in your user account without the need for administrative
privileges. This syntax is equivalent
to:action
)
comserver('register','User','current') comserver('unregister','User','current')
comserver('query')
displays installation paths of the registered
MATLAB COM servers.
s = comserver('query')
returns a structure with character vector fields:
User
— Installation path of the MATLAB registered for the current user account
Administrator
— Installation path of the MATLAB registered for all users
For users with administrative privileges, you can register and unregister MATLAB for all users from the Windows Command Prompt. For more information, see matlab
(Windows)
. If you have multiple versions of MATLAB installed on your computer, the best practice is to run the
matlab
command from the matlabroot
folder. To register MATLAB for all users, type:
matlab -batch "comserver('register','User','all')"
To unregister MATLAB for all users, type:
matlab -batch "comserver('unregister','User','all')"
Note
The comserver
function is available for MATLAB R2020a and later. To register previous versions of MATLAB, type:
matlab -regserver
matlab -unregserver