This error indicates that MATLAB is unable to read your pathdef.m file. This can occur because the permissions on your pathdef.m file prevent the user running MATLAB from reading it, but it can also occur if your pathdef.m file has become corrupted.
1) First, locate your pathdef.m file. From MATLAB, run the command
It is usually located at <matlabroot>/toolbox/local/pathdef.m. On Windows this would be:
C:\Program Files\MATLAB\RXXXXx\toolbox\local\pathdef.m
You may be able to resolve this issue by changing the permissions on your pathdef.m file.
Windows:
- Right-click on “pathdef.m” file, select “Properties”.
- Go to “Security” tab and click “Advanced”.
- Go to “Owner” tab and click “Edit”.
- Click “Other users or groups…”
- Enter “Everyone" and click “Ok”
- Under “Change owner to”, select “Everyone”. Click “Ok”
- Click “Edit…”
- Under “Group or user names”, select “Everyone”
- Click “Allow” check box for “Full control”
Mac & Linux:
Open a Terminal window Run the following command:
sudo chmod 777 $MATLABROOT/toolbox/local/pathdef.m
2) If the above does not resolve the issue then your pathdef.m file may be corrupted or have errors. Regenerate pathdef.m by performing the following steps:- Delete pathdef.m
- Open MATLAB again (you will see errors).
- Run the following commands:
>> restoredefaultpath
>> rehash toolboxcache
>> savepath
- Rename the temporary file created in <matlabroot>/toolbox/local to pathdef.m
- Restart MATLAB.
3) As a last resort, reinstalling MATLAB should resolve the issue. If reinstalling MATLAB does not resolve the issue then there may be another application on your machine which is interfering with MATLAB. If the issue persists even after reinstalling MATLAB, please contact MathWorks support .