Matlab R2007 stuck initializing

Discussion in 'Programmer's Corner' started by Dave, Jan 31, 2008.

  1. Dave

    Thread Starter Retired Moderator

    Nov 17, 2003
    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):

    Code ( (Unknown Language)):
    1. [rc p] = dos('startdir $documents\MATLAB' -a);
    Change to:

    Code ( (Unknown Language)):
    1. [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.

  2. BigCheese

    New Member

    Mar 2, 2008
    This is so much better than the 'delete MathWorks folder and try again' workaround - I am forever in your debt!! :)
  3. Dave

    Thread Starter Retired Moderator

    Nov 17, 2003
    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.

  4. lab_cox

    New Member

    Apr 27, 2009
    THANK YOU>>> U SOlve My Problem.
  5. dakt

    New Member

    Apr 4, 2009
    I have problem with Matlab on Linux.
    Once it's up and running I get this output:
    Code ( (Unknown Language)):
    2. ??? Undefined function or variable 'matlabrc'.
    4. Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    5.     at com.mathworks.mlservices.MatlabDebugServices.createStackInfo(
    6.     at com.mathworks.mlwidgets.stack.StackInfoRegistry$DBStackCallback.matlabEvent(
    7.     at com.mathworks.jmi.MatlabMCR$
    8.     at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    9.     at java.awt.EventQueue.dispatchEvent(Unknown Source)
    10.     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    11.     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    12.     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    13.     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    14.     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    15.     at Source)
    And for every command I enter I get this output:

    Code ( (Unknown Language)):
    2. >> syms x
    3. ??? Undefined function or method 'syms' for input arguments of type 'char'.
  6. KL7AJ

    AAC Fanatic!

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