Matlab R2007 stuck initializing

Thread Starter

Dave

Joined Nov 17, 2003
6,969
For those of you that might be using Matlab R2007 (this may also apply to R2006), there is a bug which means if you start Matlab for the second time in a session (a session is defined as the time between OS reboots), at start-up Matlab gets stuck in the initialisation phase. You can quit with CTRL+C, but none of the paths are set and cannot be manually set from the command line rendering MATLAB useless. The only way to get around this is to reboot your OS and try again.

Having endlessly struggled with this I have a work around:

- Close Matlab.

- Navigate to the Matlab root installation directory (by default C:\Program Files\MATLAB on Windows, and /usr/local/matlab on Linux).

- Navigate to the toolbox > local folder.

- Open userpath.m in a text editor.

- Edit the following lines (there are two of them, edit both):

Rich (BB code):
[rc p] = dos('startdir $documents\MATLAB' -a);
Change to:

Rich (BB code):
[rc p] = dos('startdir $documents\MATLAB');
- Save the userpath.m file.

Problem fixed, and so simple.

Hope this helps some who have experienced this issue.

Dave
 

Thread Starter

Dave

Joined Nov 17, 2003
6,969
This is so much better than the 'delete MathWorks folder and try again' workaround - I am forever in your debt!! :)
Glad it helped you.

Funny you should mention the Mathworks work around of deleting the Mathworks folder and, as you say, try again. The interesting thing I noticed is that this just didn't work - not even once! As a KB article I assume it was put out there as a work-around in some situations, until the actual root of the problem was found.

I only discovered this work-around after digging around after pressing CTRL+C while it was stuck initialising. Several hours later I had an answer.

Dave
 

dakt

Joined Apr 4, 2009
6
I have problem with Matlab on Linux.
Once it's up and running I get this output:
Rich (BB code):
??? Undefined function or variable 'matlabrc'.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at com.mathworks.mlservices.MatlabDebugServices.createStackInfo(MatlabDebugServices.java:326)
    at com.mathworks.mlwidgets.stack.StackInfoRegistry$DBStackCallback.matlabEvent(StackInfoRegistry.java:126)
    at com.mathworks.jmi.MatlabMCR$AWTReplyEvent.run(MatlabMCR.java:1540)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
And for every command I enter I get this output:

Rich (BB code):
>> syms x
??? Undefined function or method 'syms' for input arguments of type 'char'.
 

KL7AJ

Joined Nov 4, 2008
2,229
Glad it helped you.

Funny you should mention the Mathworks work around of deleting the Mathworks folder and, as you say, try again. The interesting thing I noticed is that this just didn't work - not even once! As a KB article I assume it was put out there as a work-around in some situations, until the actual root of the problem was found.

I only discovered this work-around after digging around after pressing CTRL+C while it was stuck initialising. Several hours later I had an answer.

Dave
Does Mathworks have a permanent solution for this? Considering their reputation, I'd be surprised if they let this bug stay buzzing for long. :)

eric
 
Top