How do I save Simlulink model to JPG or any other image formats?

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 27 de Feb. de 2013
Editada: Azzi Abdelmalek el 27 de Feb. de 2013
Manually,
  1. Open your model
  2. click on edit
  3. copy model to clipboard
  4. in paint past your image

3 comentarios

Or by line command
model % model is your model name
print('-smodel','-dbitmap','new_name')
im = imread('new_name.bmp')
% You can then save it as a jpg file
imwrite(im,'filename.jpg')
or just straight to jpg:
print(['-s',ModelName],'-djpeg',[ModelName,'.jpg'])
thanks for ur help

Iniciar sesión para comentar.

Más respuestas (3)

Harish Balaga
Harish Balaga el 3 de Jul. de 2013
Editada: Harish Balaga el 3 de Jul. de 2013
as Azzi Abdelmalek said above, print command can be used. And one can directly save it in required fomat in single command. (no need to use imead, imwite commands). Example: use
ModelName % to open the model
print('-sModelName','-dtiff','model.tiff')
to save ModelName.mdl in TIFF format. Image name will be model.tiff
replace -dtiff with -djpeg for saving the model in jpeg format

3 comentarios

I've tried using this command to save in EPS format, but didn't work. Is there a way to increase the figure resolution?
You can select the resolution with the resolution parameter:
print('-sModelName', '-dpng', 'model.png', 'r0') % Screen resolution, same as without parameter
print('-sModelName', '-dpng', 'model.png', 'r300') % Resolution of 300 dots per inch
Instead of 300, you can put what you want.
Correction in the code add a -before the resolution '-r300'

Iniciar sesión para comentar.

Anil Chowdary Tummala
Anil Chowdary Tummala el 5 de Feb. de 2021
You may use this to save simulink model as image with extension .tiff
print('-sModelName','-dtiff','model.tiff')

Categorías

Más información sobre Modeling en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 27 de Feb. de 2013

Comentada:

el 30 de Ag. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by