MATLAB: Am I getting startup warnings about R2018b folders when launching R2019a using R2019a’s default pathdef

directoriesfoldersMATLABnon-existentpathdefpreferencesstartupuserpathwarnings

When I launch MATLAB R2019a, the following warnings are printed in the Command Window:
Warning: Name is nonexistent or not a directory: C:\Program Files\MATLAB\R2019a\toolbox\matlab\connector2\file
Warning: Name is nonexistent or not a directory: C:\Program Files\MATLAB\R2019a\toolbox\matlab\connector2\framework
Warning: Name is nonexistent or not a directory: C:\Program Files\MATLAB\R2019a\toolbox\matlab\connector2\json
Warning: Name is nonexistent or not a directory: C:\Program Files\MATLAB\R2019a\toolbox\matlab\connector2\microservices
Warning: Name is nonexistent or not a directory: C:\Program Files\MATLAB\R2019a\examples\matlab_featured
Warning: Name is nonexistent or not a directory: C:\Program Files\MATLAB\R2019a\examples\stats_featured
I have multiple releases of MATLAB installed, including R2018a, R2018b and R2019a. I am not using a custom "pathdef.m" and I do not have a "startup.m" file. When I run "which -all pathdef.m", it returns the path to the default R2019a "pathdef.m" that comes with the R2019a installation of MATLAB:
>> which -all pathdef.m
C:\Program Files\MATLAB\R2019a\toolbox\local\pathdef.m
I have opened this "pathdef.m" and found no reference to any of the folders listed in the warnings in the file. Why is this happening and how can I stop it?

Best Answer

Those folders, such as "\toolbox\matlab\connector2\file", all exist in the MATLAB R2018b installation and are included in the "pathdef.m" that is shipped with MATLAB R2018b. For example, if you pasted "C:\Program Files\MATLAB\R2018b\toolbox\local\matlab\connector2\file" in the Windows File Explorer address bar, you would find that this folder exists on your computer.
Based on the warning messages, it appears that MATLAB is using a different "pathdef.m" file, such as the default 2018b one, instead of the "C:\Program Files\MATLAB\R2019a\toolbox\local\pathdef.m" one that is returned by the "which -all pathdef.m" command. This may happen if your "userpath" is set to an invalid directory, such as the empty char array. To determine if this is the case, execute the following command in the Command Window:
>> userpath
If this command returns an "0×0 empty char array" instead of a folder that exists on your computer, this may be the cause of the issue and may indicate a corrupted preferences migration or install. To resolve this issue, you can do the following:
1) Start MATLAB.
2) Set the "userpath" to be a valid folder that exists on your computer. For example, you could set the "userpath" to be your Documents folder:
>> userpath("C:\Users\username\Documents");
For more information about setting the "userpath", please refer to this documentation page linked below:
3) Restart MATLAB. The warning messages will no longer be printed.
4) If this does not resolve the issue, try regenerating your MATLAB preferences or doing a clean reinstall of MATLAB. For instructions on how to do both, please refer to the two links below: