Is there a command in MATLAB which allows saving a figure in FIG or JPEG or both formats automatically?
I don't think you can save it without it appearing, but just for saving in multiple formats use the print command. See the answer posted here: Save an imagesc output in Matlab