Skip to Main Content Skip to Search
Product Documentation

Printing and Formatting a MATLAB Notebook

Printing a MATLAB Notebook

You can print all or part of a MATLAB Notebook by doing one of the following, depending on the version of Microsoft Word you are using:

Word follows these rules when printing MATLAB Notebook cells and graphics:

Modifying Styles in the MATLAB Notebook Template

You can control the appearance of the text in your MATLAB Notebook by modifying the predefined styles stored in the notebook template, m-book.dot. These styles control the appearance of text and cells. By default, notebooks use the Word Normal style for all other text.

For example, if you print a notebook on a color printer, input cells appear dark green, output and autoinit cells appear dark blue, and error messages appear red. If you print the notebook on a grayscale printer, these cells appear as shades of gray. To print these cells using black type, modify the color of the Input, Output, AutoInit, and Error styles in the notebook template.

The following table describes the default styles used by MATLAB Notebook. If you modify styles, you can use the information in the table to help you return the styles to their original settings. For general information about using styles in Word documents, see the Word documentation.

Style

Font

Size

Weight

Color

Normal

Times New Roman

10 points

N/A

Black

AutoInit

Courier New

10 points

Bold

Dark blue

Error

Courier New

10 points

Bold

Red

Input

Courier New

10 points

Bold

Dark green

Output

Courier New

10 points

N/A

Blue

When you change a style, Word applies the change to all characters in the notebook that use that style and gives you the option to change the template. Be cautious about changing the template. If you choose to apply the changes to the template, you affect all new notebooks that you create using the template. See the Word documentation for more information.

Choosing Loose or Compact Format

You can specify whether a blank line appears between the input and output cells by selecting the loose or compact format, as follows:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, select either Loose or Compact. Loose format adds an empty line. Compact format does not.

  3. Click OK.

Controlling Numeric Output Format

To change how numeric output displays, follow these steps:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, select a format from the Numeric Format list. These settings correspond to the choices available with the MATLAB format command.

  3. Click OK.

Controlling Graphic Output

This section describes how to control several aspects of the graphic output produced by MATLAB commands in a MATLAB Notebook, including

Embedding Graphic Output in a MATLAB Notebook

By default, graphic output is embedded in a MATLAB Notebook. To display graphic output in a separate figure window, follow these steps:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, clear the Embed figures in MATLAB Notebook check box.

  3. Click OK.

Whether to embed a figure in the MATLAB Notebook is determined by the value of the figure object's Visible property. If the value of the property is off, the figure embeds in the notebook. If the value of this property is on, all graphic output appears in the current figure window.

Suppressing Graphic Output for Individual Input Cells

If an input or autoinit cell generates figure output that you want to suppress, follow these steps:

  1. Place the cursor in the input cell.

  2. Select Notebook > Toggle Graph Output for Cell.

Graphic output from the cell does not appear, and the string (no graph) appears after the input cell.

To allow graphic output for a cell, repeat the procedure. The (no graph) marker disappears and graphic output from the cell appears.

Adjusting Graphic Output

To set the default size of embedded graphics in a MATLAB Notebook, follow these steps:

  1. Select Notebook > Notebook Options.

  2. In the Notebook Options dialog box, use the Units, Width and Height fields to set the size of graphics generated by the notebook.

  3. Click OK.

Change the size of an existing embedded figure by selecting the figure, clicking the left mouse button anywhere in the figure, and then dragging the resize handles of the figure. If you resize an embedded figure using its resize handles and then regenerate the figure, its size reverts to its original size.

To crop graphic output, or add white space around it, follow the instructions for performing these tasks in Microsoft Word. See the Microsoft Word help for details.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS