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

7 vues (au cours des 30 derniers jours)
Ben
Ben le 12 Oct 2015
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!

Réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by