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

조회 수: 2 (최근 30일)
Alecsander Eitan
Alecsander Eitan 2015년 8월 20일
답변: Sean de Wolski 2015년 8월 20일
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.

답변 (1개)

Sean de Wolski
Sean de Wolski 2015년 8월 20일
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

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by