How do I define MAIN as Master script?

16 visualizaciones (últimos 30 días)
Stwiwi
Stwiwi el 10 de Oct. de 2018
Comentada: Jan el 13 de Abr. de 2021
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 comentarios
Adam
Adam el 10 de Oct. de 2018
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!
Stwiwi
Stwiwi el 10 de Oct. de 2018
okay I think this answers my question, so its not possible. Thanks

Iniciar sesión para comentar.

Respuestas (2)

Jan
Jan el 10 de Oct. de 2018
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.

Antonio Sala
Antonio Sala el 12 de Abr. de 2021
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 comentario
Jan
Jan el 13 de Abr. de 2021
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by