MATLAB: Do I get an error when starting a shared MATLAB session with a certain name after a system crash in MATLAB R2018b

MATLAB

When trying to share a MATLAB session with a certain name (I already was using before) I get the below error now, after I had a system crash and had to reboot the machine.
>> matlab.engine.shareEngine('Engine_1')
Error using matlab.engine.shareEngine (line 41)
MATLAB session 'Engine_1' already exists. Current MATLAB session is now shared with default name 'MATLAB_3192'.

Best Answer

There is a temporary file created and stored in the system's temporary directory
>> tempdir
with the defined (or default) name while sharing the session, e.g. Engine_1 for the above example.
This file is usually automatically deleted after the session is finished (and should not be removed manually in any way).
But in your case this file probably was not deleted accordingly due to the system crash. Please get it deleted manually and try to share the MATLAB session again with this name.