title: Computationally Fast Way to Save Matlab Figures as Image (eg PNG)
body: <p>I have a program that creates a lot of plots which I want to save as <code>fig001, fig002, ...</code>. At the moment, the only way I can do this is to either save them one by one as I go along using <code>print()</code> or so save them into a graphics object <code>FIG</code>.</p>
  
  <p>Unfortunately, I have to create the plots sequentially (can't parallelise it). If I save as I go, then this takes quite a long time; if I store in <code>FIG</code> then do a <code>parfor</code>-loop over all the figures, then this is faster. However, it's still pretty slow, and it's a major bottleneck in my code.</p>
  
  <p>Matlab is automatically writing a <code>1200x900</code> pixel image. In reality, it's just a graph with some (horizontal) straight lines on it. I really do not need a high image quality whatsoever; maybe reducing this would help speed things up? I can't find how to do this either.</p>
  
  <p>I've had a look online, in particular at other SE questions, but I haven't been able to come up with a solution. There's various stuff about "playing around with the <code>hardcore</code> function". I'm a mathematician who wants a code to get some intuition for the problem; I'm not a proper programmer! As such, "play around with a function" (that might cause Matlab to crash) is rather difficult for me!</p>
  
  <hr>
  
  <p>I've sorted this by using the Matlab <code>movie</code> function. Thank you Cecilia for your assistance!</p>