How do I define MAIN as Master script?
17 ビュー (過去 30 日間)
古いコメントを表示
Hey people, so I have this MAIN from where I run all my functions. Is there maybe a possibility to run the MAIN while I'm in one of the other functions by pressing F5? This way I would not have to change the script every time I want to run the MAIN. It's kind of annoying to always switch between the scripts... Maybe someone can help me:) Thanks so much Steffen
4 件のコメント
Adam
2018 年 10 月 10 日
I'm pretty sure you cannot redefine the behaviour of F5. Just pressing the up arrow in the windows command line or typing it in again if you did other things since last calling it though is not that arduous!
回答 (2 件)
Jan
2018 年 10 月 10 日
Instead of switching scripts, use functions with defined inputs and outputs. Searching for tricks to handle scripts more dynamical is a deadlock. Structured programming by using functions allows to keep the workspace clean and to be able to recreate the outputs reliably. So do not waste your time with managing scripts.
0 件のコメント
Antonio Sala
2021 年 4 月 12 日
Even if an old question, I wish to add my complaints here... I need some place to relieve my stress...
Come on, in the 1990's I had my C, C#, LaTeX etc. editors, and when you are editing a multifile "project" most of them offer you the option to "set xxxx.m/c/tex as main file". It's weird that at least the "project" workflow in Matlab does not have this silly and straightforward feature (or I don't know how to trigger it).
If somebody at Mathworks is listening, please do what many IDEs did 20 years ago:
1.) allow an "entry point" on a multi-file project (either a main.m script, a main() function, or any script that can be set to be the "main one") to be executed when F5 is pressed.
2.) Save and restore editor open windows when project is closed/reopened.
Well, this question is just about option 1) feature request, but, well... I find "project" stuff sooo disappointing compared to Visual Studio projects from 20 years ago...
1 件のコメント
Jan
2021 年 4 月 13 日
You can post this as a new question or, even better, send this directly to MathWorks as an enhancement request. Appending a complaint in the section for answers of another question hides your opinion efficiently.
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!