Startup path issue creating variable errors

조회 수: 2 (최근 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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by