A copy of "pathdef.m" is in the current workspace. Deleting this file resolves the issue. If "pathdef.m" does not exist in current workspace, please try the following troubleshooting steps:
Execute the following command in MATLAB Command Window:
This command returns the path of "pathdef.m". By default, this file should be located in
C:\Program Files\MATLAB\R20XXx\toolbox\local\
In addition, there should be only one "pathdef.m". If the output of the above command shows you have more than one "pathdef.m", please remove all "pathdef.m" which are not in the above default path.
After removing all "pathdef.m" which are not in the above default path, please launch MATLAB again and see if the issue persists.
If there is only one "pathdef.m" in your system or removing redundant "pathdef.m" does not resolve this issue, please try (a) regenerating preferences, (b) restoring MATLAB to default paths and (c) rehashing toolboxcache:
a) How do I regenerate my MATLAB preferences?
b) Restore search path to factory-installed state.
Before modifying the search path, you can take a backup of your 'pathdef.m' file, which can be located by using the command in MATLAB Command Window
Before proceeding, you should backup this file by copying it to a folder outside of your MATLAB path.
After making the backup, please execute the following commands in the MATLAB Command Window to restore the default MATLAB search path.
For more information about the above command, please take a look at the following link:
c) In MATLAB Command Window, execute the following command:
For more information about the above command, please take a look at the following link:
Best Answer