The following troubleshooting steps may help resolve MATLAB startup warnings/errors that occur after upgrading your MATLAB release, search path issues, and/or file shadowing issues. File shadowing occurs when two files with the same name are on the MATLAB path. The file with higher precedence gets called/loaded, while the other file with lower precedence is shadowed.
1. Save a copy of current MATLAB Search Path:
It is important to take a backup of the current 'pathdef.m' file, which can be located by executing the following command in the MATLAB Command Window:
Ensure that you make a copy of the file by copying it in a location different than its current folder. This is because the steps of this procedure involve regenerating the MATLAB Search Path, including resetting the 'pathdef.m' file to its initial state. This procedure will further remove custom paths you may have added in the MATLAB Search Path.
2. Restore MATLAB Search Path and rehash path cache:
After completing step 1, please execute the following commands in the MATLAB Command Window to restore the default MATLAB Search Path and rehash the toolbox cache:
>> restoredefaultpath
>> rehash toolboxcache
Restoring the MATLAB Search Path resets it to its initial state. Please refer to the 'restoredefaultpath' page for more details. Rehashing the toolbox cache updates the list of known files and classes for all folders on the MATLAB Search Path. Please refer to the 'rehash' documentation page for more details. For Simulink users, refreshing customizations in the current MATLAB session may be helpful. In addition to the above two commands, please execute the following command in the MATLAB Command Window:
>> sl_refresh_customizations
3. Save MATLAB Search Path:
After completing step 2, please use MATLAB/Simulink to verify that the initial issue has been resolved. Then you may want to save the new MATLAB search path to the 'pathdef.m' file by executing the following command:
Please refer to the 'savepath' documentation page for more details. You can then start adding your custom paths (if any) following the backed-up file and the procedure from the following documentation page: Change Folders on Search Path