I know everyone already mentioned it, but I feel the need to emphasize it whenever I can. Unless you understand what settings Matlab uses for JPG output, don't ever use it. If you're accustomed to accepting the compromises of the format when saving images in other applications, you're likely expecting way too much from Matlab.
When saving a figure or writing an image using imwrite(), the settings used for JPG output are 75% quality and 4:2:0 chroma subsampling. Even for a JPG, that's complete garbage quality, especially when you're saving the contents of a figure which is all hard edges and high contrast saturated colors.
Part of the reason why I'm compelled to comment about this is becase these parameter settings aren't clearly documented anywhere (at least not the chroma subsampling). That leaves a lot of people completely oblivious to the amount of damage they're doing to their own work.