When I got the same error message with R2018a, I reopened MATLAB with administrator access and it fixed the issue. To open MATLAB with admin access, find your MATLAB icon and right click on it and select Run as Administrator.