MATLAB: Do I receive many “Duplicate directory name” warnings when starting MATLAB

directoryduplicateMATLABmatlabpathname

I just launched MATLAB and immediately upon startup I get many messages similar to the following:
 
Warning: Duplicate directory name: /usr/local/matlab/toolbox/matlab/general.
I have not used the SAVEPATH command and have not manually set any MATLABPATH environment variable.

Best Answer

These warnings occur when the pathdef.m and the MATLABPATH environment variable have the same contents. The warnings can be removed by running RESTOREDEFAULTPATH and then running SAVEPATH. You will need permissions to write to pathdef.m.
Please note that RESTOREDEFAULTPATH sets the search path to include only folders for MathWorks installed products. It also resets the startup directory to the default directory.