MATLAB: Quit doesn’t close the program – process still running in task manager

MATLABquit

When I run the quit command in the command window or in a script, the application appears to close, but opening the Task Manager I find that there is still a process there taking up a large proportion of the CPU and memory named MATLAB.exe
It seems that it's still running in the background?

Best Answer

Splitting my script into two, with the first one handling a lot of code generation and ending with a quit, always worked fine. The second script ran tests, and ended with a quit, which has always worked fine.
Any integration of these scripts, either into a single script, or into a parent and child script (i.e. one invokes the other) caused problems with Matlab not closing properly.
It's very curious, but there must be some kind of interference between some commands that doesn't allow Matlab to close properly.
This isn't really a solution, but I'd posted the question in the hope someone knew how to force a close in some way, or perhaps had experience of the problem.
Related Question