MATLAB: How to publish high-quality, well-scaled figures and output to a PDF


I have a script that generates screen output and a bunch of figures. I wish to generate a PDF report which consists of the console output and high quality (well-scaled) figures. Now, I've been able to generate the console output + low-quality (not well scaled) images using the 'publish' command. I have also been able to save well-scaled version of each figure as a separate PDF using the print('-fillpage'..) command. Is there a way in which I can:
a) suppress printing of figures in the publish command
b) concatenate all PDFs together after the console output and high quality images have been printed
c) print to the console output at the same time as publish is being executed

Best Answer

The best solution to all your concerns would probably be to use MATLAB's Report Generator:
Report Generator creates customizable reports out of MATLAB functions. It makes it easy to save high-quality, well-scaled figures and output to a PDF, MS Word, HTML, RTF or XML document.
Here are two examples of simple workflows with Report Generator, one interactive and one programmatic:
If you are unable to switch to Report Generator, consider the following answers to your questions about the "print" function:
a) To suppress output while publishing, go to the output preferences for publishing" and set the "Evaluate Code" option to "false"
b) Report Generator makes it easy to insert high-quality images directly into your PDF. With "print" this is a bit more tricky. You will probably have to do this work outside of MATLAB. For example, you can export your figures as PDF's or JPEG's, then copy these images into a Word document that you format yourself. Though, if you need to append PDFs _within _MATLAB, check out the following method from File Exchange for concatenating PDF documents:
c) As in question (a), I would edit the "Evaluate code" option under the publishing output preferences.