Saturday, November 22, 2008

Exporting Simulink models to eps or other formats

To export Simulink models/block diagrams to eps or other image formats is easy. First, open your model. Next, use the print function to export to other formats (note the letter 's' that must precede the model name, which is entered without the '.mdl' postfix):
print -s<modelname> -d<xxx> -r<resolution> <filename.xxx>
For example, to export simmodel.mdl to eps with a resolution of 300 dpi, type
print -ssimmodel -deps -r300 simmodel.eps
The file simmodel.eps will be created in the directory where the command is entered.

For more information about image formats and print options, type
help print
Enjoy!

6 comments:

Anonymous said...

Great tip! Thanks for posting it!

I couldn't find this in the Matlab/Simulink help.

Anonymous said...

Thanks, that's great
I'd been struggling with how to do it for ages.
Matlab documentation says you can us File/SaveAs but it's lying.

Alex said...

I have one question;

How can I print a submodel to eps?
I have tried many ways of referring to the submodel but I can't figure it out.

Please help me :) the other help was already very helpful!

Thanks for this!

Alex

locksley90 said...

I don't know how to print a submodel and won't have time to investigate it but as a workaround, consider copying the submodel to a new model, save it, and print it.

gergely said...

Thanks, this post has helped me at least 3 times already:)

Anonymous said...

Hi,

To print a subsystem, just add "/yoursubsystemname" to your model name, such as:

print -ssimmodel/yoursubsystemname -deps -r300 simmodel.eps

Hope it helps. Your post helped me a lot, thanks !

Greetings from Brazil.