MATLAB: How to save the Simulink model as a TIFF or JPEG image

.jpgexportimagejpegmodelsavesimulinktiff

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

Best Answer

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')