PrintFrame Editor Overview (PrintFrame Editor)

PrintFrame Editor Search Help Desk

PrintFrame Editor Overview

User Interface

When to Use the PrintFrame Editor

The PrintFrame Editor is a graphical user interface you use to create and edit print frames for Simulink® and Stateflow block diagrams.

What PrintFrames Are

Print frames are borders containing information relevant to the block diagram, for example, the name of the block diagram. After creating a print frame, you can use Simulink or Stateflow to print a block diagram with a print frame.

This illustration shows an example of a print frame with the major elements labeled.

See the Example for specific instructions to create this print frame.


Starting the PrintFrame Editor (PrintFrame Editor)

Starting the PrintFrame Editor

Type frameedit at the MATLAB® prompt. The PrintFrame Editor window appears. The PrintFrame Editor window opens with the default print frame.

You can use frameedit filename to open the PrintFrame Editor window with the specified filename, where filename is a figure file you previously created and saved using frameedit.

Default Print Frame

The default print frame, shown below, has two rows. The top row consists of one cell and the bottom row has two cells. Default information (entries) appears in the cells, as shown below. You can keep this information, or remove the default entries and add your own. You can also add new rows and cells and then add information in them.

Getting Help for the PrintFrame Editor

Select PrintFrame Editor Help from the Help menu in the PrintFrame Editor window to access online help.

Closing the PrintFrame Editor

To close the PrintFrame Editor window, click the close box in the upper right corner, or select Close from the File menu.


Print Frame Process (PrintFrame Editor)

Print Frame Process

These are the basic steps for creating and using print frames:

  • Starting the PrintFrame Editor
  • Designing the Print Frame
  • Specifying the Print Frame Page Setup
  • Creating Borders (Rows and Cells)
  • Adding Information to Cells
  • Changing Information in Cells
  • Saving a Print Frame
  • Printing Block Diagrams with Print Frames
See also the Example.


Designing the Print Frame (PrintFrame Editor)

Designing the Print Frame

Before you create a print frame using the PrintFrame Editor, consider the type of information you want to include in it and how you want the information to appear. You might want to make a sketch of how you want the print frame to look, and note the wording you want to use.

Variable and Static Information

In a print frame, you can include variable and static information. Variable information is automatically supplied at the time of printing, for example, the date the block diagram is being printed. Static information always prints exactly as you entered it, for example, the name and address of your organization.

Single Use or Multiple Use Print Frames

You can design a print frame for one particular block diagram, or you can design a more generic print frame for printing with different block diagrams.


Specifying the Print Frame Page Setup (PrintFrame Editor)

Specifying the Print Frame Page Setup

After you have an idea of the design of your print frame, specify the page setup for the print frame.

Important:
Always begin creating a new print frame with PrintFrame Page Setup. If, instead, you begin by creating borders and adding information, and then later change the page setup, you might have to correct the borders and placement of the information. For example, if you add information to cells and then change the page setup paper orientation from landscape to portrait, the information you added might not fit in the cells, given the new orientation.

1.
In the PrintFrame Editor window, select Page Setup from the File menu.
The PrintFrame Page Setup dialog box appears.

2.
In the dialog box, specify:
  • Paper Type - for example, usletter
  • Paper Orientation - portrait or landscape
  • Margins for the print frame and the Units in which to specify the margins
3.
Click Apply to see the effects of the changes you made. Then click OK to close the dialog box.


Zooming In and Out (PrintFrame Editor)

Zooming In and Out

While using the PrintFrame Editor, you might need to zoom in on an area to better see the information or cell.

1.
Click in the area you want to zoom in on.
This selects a cell.
2.
Click the zoom in button.

The area is magnified.
3.
Click the zoom in button repeatedly to continue zooming in.
To zoom out, reducing magnification in an area, click the zoom out button. Click the zoom out button repeatedly to continue zooming out.


Creating Borders (Rows and Cells) (PrintFrame Editor)

Creating Borders (Rows and Cells)

After setting up the page, specify borders (cells) in which the block diagram and information will be placed.

Important:
Always specify the PrintFrame page setup before creating borders and adding information - see Specifying the Print Frame Page Setup. Otherwise, you might have to correct the borders and placement of the information. For example, if you add information to cells and then change the page setup paper orientation from landscape to portrait, the information you added might not fit in the cells, given the new orientation.

In the PrintFrame Editor, you create borders using rows and then create cells within the rows.

Adding and Removing Rows

You can add and remove rows in a print frame.

1.
Click within an existing row to select it. If a row consists of multiple cells, click in any of the cells in the row to select that row.
When a row is selected, handles appear on all four corners. If handles appear on only two corners, you clicked on and only selected the line, not the row.

2.
Click the add row button to create a new row.
The new row appears above the row you selected.
3.
To remove a row, select the row and click the delete row button.

Adding and Removing Cells

You can create multiple cells within a row.

1.
Select the row in which you want multiple cells.
2.
Click the split cell button.
The row splits into two cells. If the row already consists of more than one cell, the selected cell splits into two cells.
3.
To remove a cell, select the cell and click the delete cell button.

Resizing Rows and Cells

You can change the dimensions of a row or cell.

1.
Click on the line you want to move.
A handle appears on both ends of the line.
2.
Drag the line to the new location.
For example, to make a row taller, click on the top line that forms the row. Then drag the line up and the height of the row increases.

Overall Print Frame Size is Based on Page Setup

Note that the overall size of the print frame is based on the options you specified using the page setup feature. Therefore, when you change the dimensions of one row or cell, the dimensions of the row or cell next to it change in an inverse direction. For example, if you drag the top line of a row to make it taller, the row above it becomes shorter by the same amount.

To change the overall dimensions of the print frame, use the page setup feature. See Specifying the Print Frame Page Setup.


Adding Information to Cells (PrintFrame Editor)

Adding Information to Cells

1.
Select the cell where you want to add information.
2.
From the list box, select the type of information you want to add.
3.
Click the Add button.
An edit box containing that information appears in the cell. (The edit boxes for your platform might look slightly different from those in the figure below.)

4.
Click outside of the edit box to end editing mode.
Note:
If you click the Add button and nothing happens, it might be because you did not select a cell first.

Text Information

For Text, type the text you want to include in that cell, for example, the name of your organization. Press the Enter key if you want to type additional text on a new line. Note that you can type special characters, for example, superscripts and subscripts, Greek letters, and mathematical symbols. For special characters, use embedded TeX sequences - see the text command String property for a list of allowable sequences. Be sure to click outside of the edit box when you are finished in order to end editing mode.

Variable Information

All of the items in the information list box, except for the Text item, are for adding variable information, which is supplied at the time of printing. When you print a block diagram with a print frame that contains variable information, the information for that particular block diagram prints in those fields.

Types of Variable Information

The variable entries you can include are:

  • Block Diagram - This entry indicates where the block diagram is to be printed. Block Diagram is a mandatory entry. If Block Diagram is not in one of the cells, you cannot save the print frame and therefore cannot print a block diagram with it.
  • Date - The date that the block diagram and print frame are printed, in dd-mmm-yyyy format, for example, 05-Dec.-1997.
  • Time - The time that the block diagram and print frame are printed, in hh:mm format, for example, 14:22.
  • Page Number - The page of the block diagram being printed.
  • Total Pages - The total number of pages being printed for the block diagram, which depends on the printing options specified.
  • System Name - The name of the block diagram being printed.
  • Full System Name - The name of the block diagram being printed, including its position from the root system through the current system, for example, engine/Throttle & Manifold.
  • File Name - The filename of the block diagram, for example, engine.mdl.
  • Full File Name - The full path and filename for the block diagram, for example, \\matlab\toolbox\simulink\simdemos\engine.mdl.
Note:
Adding the system name or filename does not mean that you can then specify a Simulink or Stateflow system or filename in the PrintFrame Editor. It means that when you print a block diagram from Simulink or Stateflow and specify that it print with a print frame, the system name or filename of that Simulink or Stateflow block diagram prints in the specified cell of the print frame.

Format for Variable Information

When you add a variable entry, a percent sign, %, is automatically included to identify the entry as variable information rather than a text string. In addition, the type of entry, for example, page, appears in angle brackets, < >. The entry consists of the entire string, for example, %<page>, for Page Number.

Multiple Entries in a Cell

You can include multiple entries in one cell.

1.
Select the cell.
2.
Add another item from the list box.
The new entry is added after the last entry in that cell.
You can also type descriptive text to any of the variable entries without using the Text item in the information list box.

1.
Double-click in the cell.
An edit box appears around the entry.
2.
Type text in the edit box before or after the entry.
3.
Click anywhere outside of the edit box to end editing mode.
Note:
You cannot include multiple entries or text in the cell that contains the block diagram entry. %<blockdiagram> must be the only information in that cell. If there is any other information in that cell, you cannot save the print frame and therefore cannot print it with a block diagram.


Changing Information in Cells (PrintFrame Editor)

Changing Information in Cells

Use these features to change information in cells:

  • Aligning the Information in a Cell
  • Editing Text Strings
  • Removing and Copying Entries
  • Changing the Font Characteristics


Aligning the Information in a Cell (PrintFrame Editor)

Aligning the Information in a Cell

To align the information within a cell:

1.
Click within the cell to select it.
2.
Click on one of the Align buttons for left, center, or right alignment.

The information aligns within the cell.
Alignment does not apply to the cell that contains the %<blockdiagram> entry. The block diagram is automatically scaled and centered to fit in that cell at the time of printing.


Editing Text Strings (PrintFrame Editor)

Editing Text Strings

You can change text you typed in a cell:

1.
Double-click on the information you want to edit.
An edit box appears around all of the information in that cell.
2.
Click at the start of the text you want to change and drag to the end of the text to be changed.
This highlights the text.
3.
Type the replacement text.
It automatically replaces the highlighted text.
4.
Click anywhere outside of the edit box to end editing mode.
Note:
Be careful not to edit the text of a variable entry, because then the variable information will not print. For example, if you accidentally remove the % from the %<page> entry, the text <page> will print instead of the actual page number.


Removing and Copying Entries (PrintFrame Editor)

Removing and Copying Entries

You can cut, copy, paste, or delete an entry:

1.
Double-click the cursor on the information you want to remove or copy.
An edit box appears around all of the information in that cell.
2.
Click at the start of the entry you want to edit and drag to the end of that entry. This highlights the entry.
For variable information, be sure to include the entire string, for example, %<page>.
Note that for Microsoft Windows, you can select all of the entries in a cell by right-clicking on the information and choosing Select All from the pop-up menu.
3.
Use the standard editing techniques for your platform to cut, copy or delete the highlighted information.
  • For Windows, right-click in the edit box and select Cut, Copy, or Delete from the pop-up menu.
  • For UNIX, highlighting the information automatically copies it to the clipboard. If you want to remove it, press the Delete key.
If you make a mistake, use your platform's standard undo technique. For example for Windows, right-click in the edit box and select Undo from the pop-up menu.
4.
If you cut or copied the information to the clipboard and want to paste it, double-click on the entry where you want to paste it and position the cursor at the new location in that edit box. Then use the standard paste technique for your platform.
  • For Windows, right-click at the new location and select Paste from the pop-up menu.
  • For UNIX, click at the new location and then click the middle mouse button.
5.
Click somewhere outside of the edit box to end editing mode.


Changing the Font Characteristics (PrintFrame Editor)

Changing the Font Characteristics

You can change the font characteristics for the information in any cell. Specifically, you can specify the font size, style, color, and family.

1.
Right-click on the information in the cell.
The information in the cell is selected and the pop-up menu for changing font characteristics appears.

If this pop-up menu does not appear, it is because you were in edit mode. To get the font pop-up menu, click somewhere outside of the edit box surrounding the information and then right-click.
2.
Select an item from the pop-up menu. Choose Properties if you want to change the font family or if you want to change multiple characteristics at once.
Note that you can also select String from the pop-up menu, which allows you to edit the text string.
3.
Select the new font characteristic(s) for that cell. For example, for Font Size, select the new size from its pop-up menu.
Note that changing the font characteristics for the %<blockdiagram> entry is not relevant and does nothing.


Saving and Opening Print Frames (PrintFrame Editor)

Saving and Opening Print Frames

Saving a Print Frame

You must save a print frame in order to print a block diagram with that print frame. To save a print frame:

1.
Select Save As from the File menu.
The Save As dialog box appears.
2.
Type a name for the print frame in the File name edit box.
3.
Click the Save button.
The print frame is saved as a figure file, which has an .fig extension. A figure file is a binary file used for print frames.

Opening a Print Frame

You can open a saved print frame in the PrintFrame Editor, make changes to it, and save it under the same or a different name. To open an existing print frame:

1.
Select Open from the File menu
2.
Select the print frame you want to open.
All print frames are figure files.
Alternatively, you can open a print frame from the MATLAB prompt. Type frameedit filename and the PrintFrame Editor opens with the print frame file you specified.


Printing Block Diagrams with Print Frames (PrintFrame Editor)

Printing Block Diagrams with Print Frames

When using Simulink or Stateflow, you can print a block diagram with the print frame.

1.
Select Print from the Simulink or Stateflow File menu.
The Print Model dialog box appears. The dialog box shown below is for the Windows platform. The dialog box for your platform might look slightly different.

In the Print Model dialog box:

1.
Check the Frame checkbox.
2.
Supply the filename for the print frame you want to use. Either type the path and filename directly in the edit box, or click the ... button and select the print frame file you saved using the PrintFrame Editor.
Note that the default print frame filename, sldefaultframe.fig, appears in the filename edit box until you specify a different filename.
3.
Specify other printing options in the Print dialog box. For example, for Windows, specify options under Properties.
Note:
Specify the paper orientation for printing the way you normally would. The paper orientation you specified in the PrintFrame Editor's PrintFrame Page Setup dialog box is not the same as the paper orientation used for printing. For example, assume you specified a landscape-oriented print frame in the PrintFrame Editor. If you want the printed page to have a landscape orientation, you must specify that at the time of printing. For example, for Windows, click the Properties button in the Simulink or Stateflow Print Model dialog box, and for Page Setup, specify the Orientation as Landscape.

4.
Click OK in the Print dialog box.
The block diagram prints with the print frame you specified.
See also the example, Print the Block Diagram with the Print Frame.


Example (PrintFrame Editor)

Example

This example uses a Simulink demo engine model. It involves two parts - first creating a print frame, and then printing the engine model with that print frame. The final result is shown in the figure below.


Create the Print Frame (PrintFrame Editor)

Create the Print Frame

1.
At the MATLAB prompt, type frameedit.
The PrintFrame Editor window appears.
2.
Set up the page:
  1. Select Page Setup from the File menu.

    The PrintFrame Page Setup dialog box opens.

  2. For Paper Type, select a size that is appropriate for your printer.
  3. For this example, keep the Paper Orientation as Landscape and the Margins set to .75 inches.
  4. Click the OK button.

    The dialog box closes. The print frame you see in the PrintFrame Editor window will reflect your changes.

3.
Add a row at the top.
  1. Click within the upper row in the print frame, the row that contains the %<blockdiagram> entry.

    Be sure that handles appear on all four corners of the row.

  2. Click the add row button.

    A new row appears at the top, above the row you selected.

4.
Make the new row shorter.
  1. Click on the horizontal line that separates the top row (the row you just added) from the row beneath it (the row containing the %<blockdiagram> entry).

    Be sure that only two handles appear, one at each end of the line. If you see four handles in either row, click directly on the horizontal line and the other two handles disappear.

  2. Drag the line up until the top row is about the same height as the row at the bottom of the print frame.
5.
Add information in the top row.
  1. Click anywhere within the top row (the row you just added).
  2. Select Text from the information list box.
  3. Click the Add button.

    An edit box appears in the cell.

  4. Type Engine Division, press the Enter key to advance the cursor to the next line, and then type Advanced Design Group.

    Click the zoom in button if you need to magnify the entry.

  5. Click outside of the edit box to end editing mode.
6.
In the left cell of the bottom row, align the information on the left.
  1. Click the zoom out button if you need to.
  2. Click within the left cell of the bottom row to select it.
  3. Click the left alignment button.
The entry moves to the left.
7.
Make the information in the top row appear in italics.
  1. Right-click on the entry in the row.
  2. Select Font Style from the pop-up menu.

    If the pop-up menu for font properties does not appear, you are in editing mode. Click outside of the edit box to end editing mode and then right-click on the text to access the pop-up menu.

  3. From the Font Style pop-up menu, select italic.
The entry in the cell appears in italics and the information will appear in italics when the print frame is printed with a Simulink diagram.
8.
Add the total number of pages to the right cell in the bottom row.
  1. Click within the cell to select it.
  2. Add the total pages entry: select Total Pages from the information list box and click the Add button.

    The %<npages> entry appears after the %<page> entry. If you need to, zoom in to see the entry.

  3. Add the text of after the page number entry. Click the cursor after the %<page> entry, and then type of (type a space before and after the word).
The information in the cell now is: %<page> of %<npages>.
9.
Save the print frame - select Save As from the File menu. In the Save Frame dialog box, type engdivl for the File name. Click the Save button.
The print frame is saved as a figure file.
10.
You can close the PrintFrame Editor window by clicking the close box.


Print the Block Diagram with the Print Frame (PrintFrame Editor)

Print the Block Diagram with the Print Frame

1.
To view the Simulink engine model, type engine at the MATLAB prompt.
The engine model appears in a Simulink window.
2.
Double-click on the Throttle & Manifold block.

The Throttle & Manifold subsystem opens in a new window.
3.
In the Throttle & Manifold window, select Print from the File menu.
The Print Model dialog box opens with the default settings as shown here.

4.
In the Print Model dialog box, set the page orientation to landscape. This example uses the techniques for the Windows platform. Use the methods for your own platform to change the page orientation for printing.
  1. Click the Properties button.

    The Document Properties dialog box opens.

  2. Go to the Page Setup tab.
  3. For Orientation, select Landscape.
  4. Click OK.

    The Document Properties dialog box closes.

5.
In the Print Model dialog box, under Options, select Current system and below.
This specifies that the Throttle & Manifold block diagram and its subsystems will print.
6.
Check the Frame check box.
7.
Specify the print frame to use.
  1. Click the ... button
  2. In the Frame File Selection dialog box, find the filename of the print frame you just created, engdivl.fig, and select it.
  3. Click the Open button.

    The path and filename appear in the Frame edit box.

8.
Click the OK button in the Print Model dialog box.
The Throttle & Manifold block diagram prints with the print frame; it should look similar to the figure shown at the start of this example.
In addition, the Throttle block diagram and the Intake Manifold block diagram print because you specified printing of the current system and its subsystems. These block diagrams also print with the engdivl print frame, but note that their variable information in the print frame is different.