| Simulink® | ![]() |
| On this page… |
|---|
Specifying Paper Size and Orientation |
You can print a block diagram by selecting Print from the File menu or by using the print command in the MATLAB® software Command Window.
When you select the Print menu item, the Print dialog box appears. The Print dialog box enables you to selectively print systems within your model. Using the dialog box, you can print
The current system only
The current system and all systems above it in the model hierarchy
The current system and all systems below it in the model hierarchy, with the option of looking into the contents of masked and library blocks
All systems in the model, with the option of looking into the contents of masked and library blocks
The entire diagram over multiple pages
An overlay frame on each diagram
The portion of the Print dialog box that supports selective printing is similar on supported platforms. This figure shows how it looks on a computer running the Microsoft® Windows® operating system. In this figure, only the current system is to be printed.

When you select either the Current system and below or All systems option, two check boxes become enabled. In this figure, All systems is selected.

Selecting the Look under mask dialog check box prints the contents of masked subsystems when encountered at or below the level of the current block. When you are printing all systems, the top-level system is considered the current block, so the Simulink® software looks under any masked blocks encountered.
Selecting the Expand unique library links check box prints the contents of library blocks when those blocks are systems. Only one copy is printed regardless of how many copies of the block are contained in the model. For more information about libraries, see Working with Block Libraries.
The print log lists the blocks and systems printed. To print the print log, select the Include Print Log check box.
Selecting the Enable tiled printing for all systems check box overrides the tiled-print settings for individual subsystems in a model. See Tiled Printing for more information.
Selecting the Frame check box prints a title block frame on each diagram. Enter the path to the title block frame in the adjacent edit box. You can create a customized title block frame, using the MATLAB product frame editor. See frameedit for information on using the frame editor to create title block frames.
You can specify the type and orientation of the paper used to print a model diagram. You can do this on all platforms by setting the model's PaperType and PaperOrientation properties, respectively (see Model and Block Parameters), using the set_param command. You can set the paper orientation alone, using the MATLAB software orient command. On computers running the Windows, operating system, the Print and Printer Setup dialog boxes let you set the page type and orientation properties as well.
You can use a model's PaperPositionMode and PaperPosition parameters to position and size the model's diagram on the printed page. The value of the PaperPosition parameter is a vector of form [left bottom width height]. The first two elements specify the bottom-left corner of a rectangular area on the page, measured from the page's bottom-left corner. The last two elements specify the width and height of the rectangle. When the model's PaperPositionMode is manual, the Simulink software positions (and scales, if necessary) the model's diagram to fit inside the specified print rectangle. For example, the following commands
vdp
set_param('vdp', 'PaperType', 'usletter')
set_param('vdp', 'PaperOrientation', 'landscape')
set_param('vdp', 'PaperPositionMode', 'manual')
set_param('vdp', 'PaperPosition', [0.5 0.5 4 4])
print -svdp
print the block diagram of the vdp sample model in the lower-left corner of a U.S. letter-size page in landscape orientation.
If PaperPositionMode is auto, the Simulink software centers the model diagram on the printed page, scaling the diagram, if necessary, to fit the page.
By default, each block diagram is scaled during the printing process such that it fits on a single page. That is, the size of a small diagram is increased or the size of a large diagram is decreased to confine its printed image to one page. In the case of a large diagram, scaling can make the printed image difficult to read.
By contrast, tiled printing enables you to print even the largest block diagrams without sacrificing clarity and detail. Tiled printing allows you to distribute a block diagram over multiple pages. You can control the number of pages over which the Simulink software prints the block diagram, and hence, the total size of the printed diagram.
Moreover, different tiled-print settings are accommodated for each of the systems in your model. Consequently, you can customize the appearance of all printed images to best suit your needs. The following sections describe how to utilize tiled printing.
To enable tiled printing for a particular system in your model, select the Enable Tiled Printing item from the File menu associated with that system's Model Editor.
Or you can enable tiled printing programmatically using the set_param command. Simply set the system's PaperPositionMode parameter to tiled (see Model Parameters). For example, the following commands
sldemo_f14
set_param('sldemo_f14/Controller', 'PaperPositionMode', 'tiled')open the f14 demo model and enable tiled printing for the Controller subsystem.
To enable tiled printing for all systems in your model, select the Enable tiled printing for all systems check box on the Print dialog box (see Print Dialog Box). If you select this option, the Simulink software overrides the individual tiled-print settings for all systems in your model.
You can display the page boundaries in the Model Editor to visualize the model's size and layout with respect to the page. To make the page boundaries visible for a particular system in your model, select the Show Page Boundaries item from the View menu associated with that system's Model Editor. Or you can display the page boundaries programmatically using the set_param command. Simply set the system's ShowPageBoundaries parameter to on (see Model Parameters).
The Simulink software renders the page boundaries on the Model Editor's canvas. If tiled printing is enabled, page boundaries are represented by a checkerboard pattern. As illustrated in the following figure, each checkerboard square indicates the extent of a separate page.

If tiled printing is disabled, only a single page is displayed on the Model Editor's canvas.
You can use a system's TiledPageScale and TiledPaperMargins parameters to customize certain aspects of tiled printing. You specify values for these parameters using the set_param command.
The TiledPageScale parameter scales the block diagram so that more or less of it appears on a single tiled page. By default, its value is 1. Values greater than 1 proportionally scale the diagram such that it occupies a smaller percentage of the tiled page, while values between 0 and 1 proportionally scale the diagram such that it occupies a larger percentage of the tiled page. For example, a TiledPageScale of 0.5 makes the printed diagram appear twice its size on a tiled page, while a TiledPageScale of 2 makes the printed diagram appear half its size on a tiled page.
You can specify the margin sizes associated with tiled pages using the TiledPaperMargins parameter. The value of TiledPaperMargins is a vector of form [left top right bottom]. Each element specifies the size of the margin at a particular edge of the page. The value of the PaperUnits parameter is used to determine its units of measurement. Each margin to 0.5 inches by default. By decreasing the margin sizes, you can increase the printable area of the tiled pages.
By default, all of a system's tiled pages are printed when you select Print from the File menu or use the print command at the MATLAB software prompt.
Alternatively, you can specify the range of tiled page numbers that are printed printed, as follows:
On a computer running the Microsoft Windows operating system, you can specify a range of tiled page numbers to be printed using the Print range portion of the Print dialog box. This field is accessible if you select both the Current system and Enable tiled printing for all systems options (see Print Dialog Box).

On all platforms, you can specify a range of tiled page numbers to be printed using the print command at the MATLAB software prompt. The print command's tileall option enables tiled printing for the system, and its pages option indicates the range of tiled page numbers to be printed (see Print Command). For example, the following commands
vdp
set_param('vdp', 'PaperPositionMode', 'tiled')
set_param('vdp', 'ShowPageBoundaries', 'on')
set_param('vdp', 'TiledPageScale', '0.1')open the vdp demo model, enable tiled printing, display the page boundaries, and scale the tiled pages such that the block diagram spans multiple pages. You can print the second, third, and fourth pages by issuing the following command at the MATLAB software prompt:
print('-svdp', '-tileall', '-pages[2 4]')Note The Simulink software uses a row-major scheme to number tiled pages. For example, the first page of the first row is 1, the second page of the first row is 2, etc. |
The format of the print command is
print -ssys -device -tileall -pagesp filename
sys is the name of the system to be printed. The system name must be preceded by the s switch identifier and is the only required argument. sys must be open or must have been open during the current session. If the system name contains spaces or takes more than one line, you need to specify the name as a string. See the examples below.
device specifies a device type. For a list and description of device types, see the documentation for the MATLAB software print function.
tileall specifies the tiled printing option (see Tiled Printing).
p is a two-element vector specifying the range of tiled page numbers to be printed. The vector must be preceded by the pages switch identifier. This option is valid only when you enable tiled printing using the tileall switch. For an example of its usage, see Printing Tiled Pages.
filename is the PostScript® file to which the output is saved. If filename exists, it is replaced. If filename does not include an extension, an appropriate one is appended.
For example, this command prints a system named untitled.
print -suntitled
This command prints the contents of a subsystem named Sub1 in the current system.
print -sSub1
This command prints the contents of a subsystem named Requisite Friction.
print (['-sRequisite Friction'])
The next example prints a system named Friction Model, a subsystem whose name appears on two lines. The first command assigns the newline character to a variable; the second prints the system.
cr = sprintf('\n');
print (['-sFriction' cr 'Model'])
To print the currently selected subsystem, enter
print(['-s', gcb])
![]() | Saving a Model | Generating a Model Report | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |