Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

How to View Sample Time Information

Viewing Sample Time Display

Simulink models can display color coding and annotations that represent specific sample times. As shown in the table Designations of Sample Time Information, each sample time type has one or more colors associated with it. You can display the blocks and signal lines in color, the annotations in black, or both the colors and the annotations. To choose one of these options:

  1. In the Simulink model window, select Format > Sample Time Display.

  2. Select Colors, Annotations, or All.

Selecting All results in the display of both the colors and the annotations. Regardless of your choice, Simulink performs an Update Diagram automatically. To turn off the colors and annotations:

  1. Select Format > Sample Time Display.

  2. Select None.

Simulink performs another Update Diagram automatically.

Your Sample Time Display choices directly control the information that the Sample Time Legend displays.

Managing the Sample Time Legend

You can view the Sample Time Legend for an individual model or for multiple models. Additionally, you can prevent the legend from automatically opening when you select options on the Sample Time Display menu.

Viewing the Legend

To assist you with interpreting your block diagram, a Sample Time Legend is available that contains the sample time color, annotation, description, and value for each sample time in the model. You can use one of three methods to view the legend, but upon first opening the model, you must first perform an Update Diagram.

  1. In the Simulink model window, select Edit > Update Diagram.

  2. Select View > Sample Time Legend or press Ctrl +J.

In addition, whenever you select Colors, Annotations, or All from the Sample Time Display menu, Simulink updates the model diagram and opens the legend by default. The legend contents reflect your Sample Time Display choices. By default or if you have selected None , the legend contains a description of the sample time and the sample time value. If you turn colors on, the legend displays the appropriate color beside each description. Similarly, if you turn annotations on, the annotations appear in the legend.

The legend does not provide a discrete rate for all types of sample times. For asynchronous and variable sample times, the legend displays a link to the block that controls the sample time in place of the sample time value. Clicking one of these links highlights the corresponding block in the block diagram. The rate listed under hybrid and asynchronous hybrid models is "Not Applicable" because these blocks do not have a single representative sample time.

For subsequent viewings of the legend, you must repeat the Update Diagram to access the latest known information.

Turning the Legend Off

If you prefer not to view the legend upon selecting Sample Time Display:

  1. In the Simulink model window, select File > Preferences.

  2. Scroll to the bottom of the main Preferences pane.

  3. Clear Open the Sample Time Legend whenever the Sample Time Display is changed.

Viewing Multiple Legends

If you have more than one model open and you view the Sample Time Legend for each one, a single legend window appears with multiple tabs. Each tab contains the name of the model and the respective legend information. The following figure shows the tabbed legends for SampleTimeSpecify.mdl and vdp_viewers.mdl.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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