title: Save image from axes in MATLAB
body: <p>I generate a picture in an axes that is called newIM when I click on the apply button.
  Now, I want to save this new picture in a jpg, gif, bmp or whatever file when I push the save button.</p>
  
  <p>This is what I had:</p>
  
  <pre><code>pathname = 'D:\pictures\';
  filename = 'Test.bmp';
  both = strcat(pathname, filename);
  imshow(both);
  imsave('test','*.jpg')
  </code></pre>
  
  <p>But this is only for a Test.bmp and not for the picture in newIM.</p>
  
  <p>How can I make this variable?</p>