Suppress figure windows when using publish

I have several graphs and uitables in my script. When I publish it, it opens new figure windows to plot graphs. I close them automatically when it's done, but I'd like to prevent creating the windows in the first place.
I've tried set(0,'DefaultFigureVisible','off'), set(gcf,'visible','off'), figure('visible', 'off');
All of them did not create figure windows but the graphs also didn't appear in my published pdf file.
Anyone know how to publish graphs without opening the figure window? Thank you.

답변 (1개)

Aniket
Aniket 2025년 5월 7일

0 개 추천

As of R2024b, there is no publishing option to prevent figure windows from appearing while still capturing them in the report. However, you can create custom functions to force a particular figure to be included in your published document, then you can close the figure to prevent too many figures from cluttering your screen.
Hope this helps!

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품

질문:

2015년 3월 18일

답변:

2025년 5월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by