Startup path issue creating variable errors

8 ビュー (過去 30 日間)
Mollie Passacantando
Mollie Passacantando 2020 年 1 月 7 日
編集済み: Stephen23 2020 年 1 月 7 日
I just deleted and installed a clean version of Matlab R2019b, because i was getting the error
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup, which should
be resolved as soon as possible. Error detected was:
MATLAB:load:couldNotReadFile
Unable to read file 'matlab.mat'. No such file or directory.
My startup.m was just 'load matlab.mat', so I saved the workspace as matlab.mat, and was able to run the application, but not add certain specific paths in that I wanted without getting a persistent popup saying "Variables - an unexpected error has occurred"
I tried restoredefaultpath and rehash toolboxcache, as well as restoredefaultpath;matlabrc .
Now, on the clean install, matlab can't find startup.m.
>> which startup.m
'startup.m' not found.
How is it possible that I don't have a startup.m file on a clean install? Please let me know if you have any thoughts, thanks in advance

回答 (1 件)

Stephen23
Stephen23 2020 年 1 月 7 日
編集済み: Stephen23 2020 年 1 月 7 日
"How is it possible that I don't have a startup.m file on a clean install"
Because it is a clean install: MATLAB does not create this file, it is created by the user:
"Please let me know if you have any thoughts"
The documentation states "Create a startup.m file in the userpath folder, which is on the MATLAB® search path. Add commands you want executed at startup....", so that is probably what I would do, e.g. create a script with that name and save it in your startup folder:

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by