Installation guide

Publishing to HTML, XML, LaTeX, Word, and PowerPoint Using Cells
the start of a cell appear as plain text. Comments appearing after code in a
cell appear as unformatted M-file comments in the published document.
2 Use Cell > Insert Text Markup to insert markup symbols in the M-file
comments to stylize the text for the output, for example, to disp lay specified
text as bold or monospaced. For details, see “Marking Up Text in Cells for
Publishing” on page 8-11.
3 When publishing an M-file function, select
File > Preferences > E ditor/Debugger > Publishing,and
clear th e Evaluate code option.
4 Select File > Publish To,andselecttheformatinwhichyouwantto
publish the M-file: H TML, XML , LaTeX, Word, or PowerPoint. For details,
see “Publishing M-Files Using Cells” on page 8-24.
5 Change the Editor/Debugger P ublishing and Publishing Im ages
preferences to adjust the output. For example, you can choose to include
or exclude the code from the output. For details, see “Modifying Published
Output Using Preferences” on page 8-26.
MATLAB publishes the M-file by writing the cell titles, comment text, and
code to a file using the s pecified format. For M-file scripts, MATLAB also
evaluates the cells and writes the results of the evaluation to the output file.
Any figures created or modified during the evaluation are saved as graphics
files, and are shown with the results.
Publishing Scripts and Functions—Differences
When you publish M-file scripts, MATLAB runs the code and the published
output includes th e results.
When you publish M-file functions, MATLAB does not run the code, so the
published output does not include results. Publishing an M-file function
allows you to effectively save the M-file code along with formatted M -file
comments. The instructions for publishing M-files apply to M-file functions,
with the exception of steps that inv olve evaluating code and displaying results
from running the file.
If y o u want to publish an M-file functio n that includ es results, change the
M-file function to a script. Remove the function declaration statement and
8-3