Problem Saving UIFigures when running in parallel

6 ビュー (過去 30 日間)
Eli
Eli 2024 年 8 月 19 日
回答済み: Avni Agrawal 2025 年 1 月 28 日 8:31
Attempts to save UIFigure inside a parfor loop using getframe or exportgraphics dont seem to work. Returning the error that these functions cant be used in nodisplay mode. I rely on a 3rd party function ft_topoplot_er to plot certain topographs on my UIFigure and save the resulting video, but these calls take some time done sequentially, so I wished to parallelise them using parfor yet I'm unable to do so.

回答 (1 件)

Avni Agrawal
Avni Agrawal 2025 年 1 月 28 日 8:31
Hi Eli,
I understand that you are trying to export the contents of a figure, including all graphical elements and UI components. To achieve this, you can utilize the exportapp function. This function captures the entire content of the specified figure (fig) and saves it to a file with the name you provide (filename).
Here is an example of how you can use it:
exportapp(fig, filename)
For further details and advanced usage, please refer to the official documentation: https://www.mathworks.com/help/matlab/ref/exportapp.html.
I hope this helps!

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by