Can I know if a script is currently being run normally (F5) or being published?

6 visualizaciones (últimos 30 días)
Hello,
I use Matlab to tune algorithms. When done, I typically publish the results to doc or PDF. Before publishing, I typically add specific explanatory text output and graphical formatting instructions that are normally not needed.
When I run the script normally I don't need those because they slow the program down. But when I publish results occasionally, I need them. For the moment, I declare a PUBLISH variable to 0 or 1 at the beginning of the script and do the formatting stuff only if the value is 1. It works but it's a bit cumbersome becaise I need to remember to change the value.
I'd like to know if there is a way, from within a script, to know whether said script is being run normally (e.g. launched from F5) or whether it is being published? Something like an isBeingPublished boolean, for example?
Thanks in advance for your help!

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by