printing simulink model onlyprints one block

14 Ansichten (letzte 30 Tage)
Af
Af am 10 Mär. 2019
Beantwortet: junny am 11 Sep. 2025 um 13:49
Hi,
I am trying to export a simulink blockdiagram in a high resolution picture format.
I am using the print command as follows:
print('-sResonatingSystem','-dtiff','-r600','Figure38.tiff')
or
print('-sResonatingSystem','-dpng','-r600','Figure38.png')
but this only prints one block of the entire block diagrm.
the blcok diagram is very simple and has only three blocks
I did not define any mask or somethign like that
I use matlab 2018a.
Any hint?
regards,
Afshin

Akzeptierte Antwort

Vijaya Lakshmi Chagi
Vijaya Lakshmi Chagi am 13 Mär. 2019
Hi Afshin,
I observed that you are using a resolution of 600 DPI which is why you are getting one block saved in the image. Reducing the resolution size will save the entire block diagram in the image.
Refer to the following documenation link which explains you to choose the right resolution for your use case: https://www.mathworks.com/help/matlab/ref/print.html#bukyb6e-1-resolution
To print a very high resolution image, you could use the SVG (Scalable Vector Graphic) format as that scales well.
The following command shows how to use the svg format.
>> saveas(get_param('untitled','Handle'),'MySimulinkDiagram.svg') % where 'untitled' is the name of the model
You could then convert the svg file to png using an online third party tool. See the following link to convert the file. There are more tools available online.https://svgtopng.com/
The other possible high resolution image can be obtained by printing a model to PDF format.
I hope the above information helps.
  1 Kommentar
Af
Af am 17 Mär. 2019
Thanks a lot! when I did the procedure as outlined above the default resolution was 72 dpi so imported the svg file into Gimp and then increase the resolution to 600 and then exported as a PNG file.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

junny
junny am 11 Sep. 2025 um 13:49
I had the same issue—600 DPI only saved one block. Exporting as SVG works much better, and if you need icons or PNGs later, this SVG to ICO online tool does the job right in the browser.

Kategorien

Mehr zu Interactive Model Editing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by