MATLAB: Warning: Name is nonexistent or not a directory

errorMATLABpathrestoredefaultpath

Every time I start up MATLAB, I receive this message:
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\mexw32.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\special.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\sift.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\plotop.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\mser.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\misc.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\kmeans.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\imop.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\geometry.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox\aib.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\vlfeat\toolbox.
Warning: Name is nonexistent or not a directory: xml_toolbox.
Warning: Name is nonexistent or not a directory:
C:\POSTDOC\Hand_Mathias\videoIO.
How do I fix this?

Best Answer

If there are some folders in the path you'd still like to keep on the path, and just remove the one folder that it is complaining about,
  1. Go to the "Home" tab of the tool ribbon,
  2. Click the SetPath icon.
  3. Then locate the missing folder(s) and highlight them.
  4. Click Remove, Save, and Close.
You should not see the missing folders listed the next time you start MATLAB.
If the above does not work, check your startup.m file by typing "edit startup.m" on the command line. If everything looks fine there (no addpaths with non-existent folders).
Finally, as a last resort, you can issue the line
restoredefaultpath
savepath
to get back to initial "right out of the box" conditions just as if you'd reinstalled MATLAB. This will remove any folders that you have added to the search path after you installed MATLAB and get you back to the original default path.