Desktop Tools and Development Environment Previous page   Next Page

Recovering from Problems with the Search Path

If you get unexpected results that are related to the search path, you can try to correct the path file or restore the default path. You might experience path problems if you save the path on a Windows platform and then try to use the same pathdef.m file on a UNIX platform. Similarly, you might experience problems if you edit the pathdef.m file directly and make it invalid, or if the file becomes corrupt, renamed, or lost.

For example, if an error message similar to the following appears when you start MATLAB

Warning: MATLAB did not appear to successfully set the search 
path...

it indicates a problem with the search path and you will not be able to use MATLAB successfully.

To recover from problems with the search path, try the following, in order, proceeding to the next step only if needed:

  1. View the pathdef.m and startup.m files, looking for obvious problems. Make changes and save them. If path problems appear to be resolved, start MATLAB again to be sure the problem does not reappear. Depending on the problem, you might not be able to even view the pathdef.m file.
  2. Use the default path for MathWorks products. In the Set Path dialog box, select Default, then Save, then Close. Depending on the problem, you might not be able to even open the dialog box.
  3. Run restoredefaultpath. This sets the search path to include only installed products from The MathWorks. If that seems to have corrected the problem, run savepath. Start MATLAB again to be sure the problem does not reappear.
  1. Depending on the problem, this might generate a message such as

    If so, perform step 4.

  1. Perform these steps after trying step 3.
    1. Run
      • 
            restoredefaultpath; matlabrc
        
    1. If there is a pathdef.m in your startup directory for MATLAB, it caused the problem. So either remove the bad pathdef.m file or replace the with a good pathdef.m file, for example, one you can generate at this point with
      • 
            savepath('path_to_your_startup_directory/pathdef.m')
        
    2. Start MATLAB again to be sure the problem does not reappear.

Previous page  Using the Path in Future Sessions File Management Operations Next page

© 1994-2005 The MathWorks, Inc.