MATLAB: Do I receive an error message when I attempt to run NOTEBOOK in MATLAB

actxserverMATLABnotebookregserver

When I attempt to start Notebook in Microsoft Word by typing
notebook
at the MATLAB command prompt, I instead receive the error message
??? Error using ==> actxserver
Server creation failed. Invalid ProgID 'matlab.application'
Error in ==> notebook>startMatlabAutomationServer at 273
hAppMatlab = actxserver('matlab.application');
Error in ==> notebook at 38
hAppMatlab = startMatlabAutomationServer(hAppMatlab);

Best Answer

You are seeing the error because MATLAB has not yet been registered as a Component Object Model (COM) server. To perform this registration, MATLAB needs to be started once with the "-regserver" startup option. To do this, please perform the following steps:
1. Close MATLAB, then go to the icon from which you start MATLAB, right click on it, and select "Properties"
2. In the "Target" field, you will see the file path that Windows uses to execute MATLAB. To the end of this path, add a space and then write:
-regserver
Click "OK" to save the change.
3. Start MATLAB. The NOTEBOOK command should now work properly.
4. Because the registration need only be performed once, you should now repeat steps 1 through 3 and remove the "-regserver" flag from the MATLAB shortcut path.