the path file pathdef.m might be read-only
In Matlab, enter:
>> which pathdef
/usr/local/MATLAB/R2018a/toolbox/local/pathdef.m
Enter a Linux terminal and change file permissions to read and write for anyone.
sudo chmod 666 /usr/local/MATLAB/R2018a/toolbox/local/pathdef.m