Matlab can save/export figures to Encapsulated Postscript (EPS) files but apparently lacks a "imwrite" mechanism to directly save a Matlab array into an EPS file. Often it takes time to print figures into an EPS file, problems with white borders etc...

Here is a small piece of code, fruit of my frustration and of a few others in my lab. It provides a Matlab command, "writeeps” that finally does that, with syntax identical to “imwrite”: array + filename. The code has been adapted from a part of an ImageMagick source file "ps.c".

Voila!

 

Download the im2eps zip file here, uncompress it and read the … “readme.txt” file for the description, installation, use and legal stuffs!