Statup script executes as a function
古いコメントを表示
Hi there,
I defined a startup.m script to excute when I start MatLab. I followed all of the instructions in Specify Startup Options.
When I start MatLAb, I get the following error lines
Attempt to execute SCRIPT startup as a function:
C:\Users\antho\Documents\MATLAB\StartupDir\startup.m
Hopefully the startup script does work properly! But it is very anoying to have that "error sound" and message that appears everytime I run MatLab ...
Here is my startup.m file
set(groot, ...
'defaultAxesFontSize',14, ...
'defaultAxesLabelFontSize',1.35, ...
'defaultTextFontSize',14, ...
'defaultTextFontSizeMode','manual',...
'defaultLegendFontSize',18, ...
'defaultLegendFontSizeMode','manual',...
...
'defaultTextInterpreter','latex',...
'defaultAxesTickLabelInterpreter','latex',...
'defaultLegendInterpreter','latex',...
...
'defaultLineLineWidth',2, ...
...
'defaultAxesXGrid','on', ...
'defaultAxesYGrid','on', ...
'defaultLegendBox','on', ...
'defaultLegendLocation', 'northeast',...
'defaultAxesBox', 'on' ...
)
%% Check
disp('statup.m all done!');
It isn't a function, and it should not be one!
Do anyone knows how to fix this ?
Thanks!
Anthony.
6 件のコメント
Prudhvi Peddagoni
2021 年 1 月 19 日
Hi,
I have tried reproducing this on MATLAB 2020a on windows. I did not get any error.
I have created a file named startup.m in the path given by userpath command. And added this script to it. I did not get any error message or sound. Can you tell me which MATLAB version you are using?
Anthony Amorosi
2021 年 1 月 21 日
Stephen23
2021 年 1 月 21 日
@Anthony Amorosi: please show the complete output of this command:
which startup -all
Anthony Amorosi
2021 年 1 月 21 日
編集済み: Anthony Amorosi
2021 年 1 月 21 日
Interesting. Try the following:
- rename the file (e.g. add an X to the name)
- rehash the toolbox cache https://www.mathworks.com/help/matlab/ref/rehash.html
- restart MATLAB
- try creating an empty startup script.
- restart MATLAB
Do you have any third-party toolboxes installed?
Anthony Amorosi
2021 年 1 月 21 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!