It might be the same as this answer. The error occurs when MATLAB cannot access to MATLAB's preferences directory.
Keep in minds that your hard disk is not full.
Delete your current preferences directory (~/.matlab/R2018a in Linux, C:\Users\YOUR_USER_NAME\AppData\Roaming\MathWorks\MATLAB\R2018a in Windows) and restrat MATLAB.
If the issue exsits, change the environment variable "MATLAB_PREFDIR" as described in the above answer.