フィルターのクリア

Does exportgrahics work with simulink diagrams?

5 ビュー (過去 30 日間)
jessupj
jessupj 2021 年 9 月 8 日
編集済み: Richard Quist 2021 年 12 月 17 日
I've been using
saveas(get_param(gcs,'Handle'),filename,'png')
to take images (albeit low-res crummy) of simulink diagrams. I also noticed that R2020a introduced (?) exportgraphics. But the parallel syntax fails:
exportgraphics(get_param(gcs,'Handle'),filename,'png')
Error using exportgraphics
First parameter must specify the axes or chart object
Is there a newer way to export simulink views to PNG (or other formats) using exportgraphics so that e.g output resolution can be supplied? It seems like there is no way to resolution options to saveas.
(The alternative seems like screenshotting or printing to PDF and then converting to PNG, but i feel like i'm missing some basic existing functionality.)

回答 (1 件)

Richard Quist
Richard Quist 2021 年 12 月 17 日
編集済み: Richard Quist 2021 年 12 月 17 日
exportgraphics only supports graphics charts/plots; it does not support Simulink models. From the documentation:
saves the contents of...any type of axes, a figure, a standalone visualization, a tiled chart layout, or a container within the figure
For higher quality output from Simulink models the recommendation is to use a vector format such as SVG or PDF:
saveas(get_param(gcs, 'handle'), 'output.pdf')

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by