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 windowSave the model as a meta-file (EMF) by using the following command:print -smodelname -dmeta outputfilenameSave the model as a bitmap (BMP) by using the following command:print -smodelname -dbitmap outputfilename2. 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') Related SolutionsMATLAB: How to save Simlulink model to JPG or any other image formats Manually,Open your modelclick on editcopy model to clipboardin paint past your image MATLAB: Does an invisible figure become visible when I save a bitmap image using the PRINT function in MATLAB We have verified that there is a bug in MATLAB 7.0 (R14) related to the use of the -dbitmap flag with the PRINT function.To work around this issue, you can use the -dbmp flag which also saves in the bitmap format, as in the following example:print -dbmp foo.bmp Related QuestionHow to save Simulink model as pictureHow to import an image of the Simulink model directly to a MATLAB variableIs it possible to create Simulink model SVG screenshots using PRINT command in MATLAB 7.7(R2008b)Does the SAVEAS function produce an image with an erroneous single grey pixel in the top left corner in MATLAB 6.5 (R13)
Best Answer