Effacer les filtres
Effacer les filtres

How can I know in a function/script that it is run in Publish mode?

3 vues (au cours des 30 derniers jours)
Alecsander Eitan
Alecsander Eitan le 20 Août 2015
How can I know in a function/script that it is run in Publish mode? I need this feature to tune the outputs to screen. Program runs for long time and I need some feedback in normal mode but I must not have them in Publish mode. I also would like to tune some figures according to the mode: Interactive, Publish & GUI controlled.

Réponses (1)

Sean de Wolski
Sean de Wolski le 20 Août 2015
Look at dbstack. You could write a function which looks through the stack to see if publish was used:
function out = ispublishing()
st = dbstack;
out = any(arrayfun(@(x)strcmp(x.file,'publish.m'),st));
end

Catégories

En savoir plus sur Graphics Object Identification dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by