MATLAB: Startup.m not found in local folder

MATLABstartup.m

my Matlab (2019a, but it happened also with previous versions) on Window10 does not find the custom startup.m that I put in the in the folder c:\Program Files\MATLAB\R2019a\toolbox\local\
The folder is in the path.
Any command there (including startupsav.m) is found, but not startup.m, even though is there. That is so strange.
The folder cannot be written without Administrator privilege but I force it to put the custom startup there, anyway.
Maybe that explains the unexpected behavior?
Thanks for the support
Paolo

Best Answer

In previous releases, the toolbox path cache contained information about files in the toolbox subdirectory underneath matlabroot. As of release R2017b, the cache now contains information about files underneath matlabroot. Compare the documentation page about toolbox path caching in the current release and the same documentation page in the release R2017a documentation.
As stated on that documentation page: "We strongly recommend that you save any MATLAB code files you create and any files provided by MathWorks that you edit in a folder that is not in the matlabroot folder tree. If you keep your files in the matlabroot folder, then they might be overwritten when you install a new version of MATLAB." If you need to control where MATLAB starts, updating the properties of the shortcut is one way to do it. There are other ways as well.