MATLAB: Does MATLAB hang when I use the SIM command in a for loop in MATLAB 7.0 (R14)

freezehangMATLABscriptsim

I have a script that calls the SIM command inside a loop. It works for a while, but then MATLAB hangs at the SIM command. MATLAB does not return from the script but also does not take any of the CPU time to continue processing.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This problem has been fixed in MATLAB 7.0.1 (R14SP1). If you are using a previous version, read the following:
We have verified that there is a bug in MATLAB 7.0 (R14) in the way that MATLAB handles queued events. The SIM command directly or indirectly interacts with the MATLAB interpreter. This interaction occurs through IQM (Interpreter Queue Manager) events. It is not the SIM command that hangs. In some instances, the IQM loses the event, causing the hang. To work around this issue, you can start MATLAB with the -nojvm option.