How do I save my Simulink model as a TIFF or JPEG image?

Illustration
Maximiliano - 2020-09-16T11:20:42+00:00
Question: How do I save my Simulink model as a TIFF or JPEG image?

I would like to save my Simulink model as a TIFF or JPEG image. However, the following code does not apply to Simulink models: print -smodelname -dtiff

Expert Answer

Profile picture of John Michell John Michell answered . 2025-11-20

This enhancement has been incorporated in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
The Simulink window is not a traditional MATLAB figure window; therefore, it cannot be directly saved as a TIFF or JPEG image.
As a workaround, you can try the following:
1. Save the model as a metafile or as a bitmap by using the following command:
modelname  %to make the model the current window

Save the model as a meta-file (EMF) by using the following command:

print  -smodelname -dmeta outputfilename

Save the model as a bitmap (BMP) by using the following command:

print -smodelname -dbitmap outputfilename

2. If the file is a Windows meta-file, use another program, such as LviewPro, to open the file and resave it as a TIFF image.

 If the file is a bitmap, use IMREAD to read the bitmap into MATLAB.

A = imread('filename.bmp','bmp')

Then use IMWRITE to save the file as a TIFF image.

imwrite(A,'filename.tif','tif')


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!