title: MATLAB - write image into an eps file
body: <p>In MATLAB, how do you write a matrix into an image of <a href="http://en.wikipedia.org/wiki/Encapsulated_PostScript" rel="nofollow noreferrer">EPS</a> format?</p>
  
  <p>It seems <code>imwrite</code> does not support EPS.</p>
  
  <p>Convert is not working on the Linux server I am using:</p>
  
  <pre><code>$ convert exploss_stumps.jpg exploss_stumps.eps
  convert: missing an image filename `exploss_stumps.eps' @ convert.c/ConvertImageCommand/2838
  </code></pre>
  
  <p>Why?</p>
  
  <hr>
  
  <p>I tried gnovice's idea under terminal mode:</p>
  
  <pre><code>    figH = figure('visible','off') ;
  imshow(img,'border','tight',...      %# Display in a figure window without
          'InitialMagnification',100);  %#    a border at full magnification
  print(strcat(filepath,'/', dataset,'_feature_',num2str(j), '.eps'),'-depsc2');
      close(figH) ;
  </code></pre>
  
  <p>However I got:</p>
  
  <blockquote>
    <p>??? Error using ==> imshow at 191 <br/>
    IMSHOW requires Java to run. <br/>
     <br/>
    Error in ==> study_weaker at 122 <br/>
        imshow(img,'border','tight',...      %# Display in a figure window without <br/>
     <br/>
    191       error(eid,'%s requires Java to run.',upper(mfilename)); <br/></p>
  </blockquote>
  
  <p>How can I fix it?</p>