Skip to Main Content Skip to Search
Product Documentation

hilite_system - Highlight Simulink object

Syntax

hilite_system(block_path)
hilite_system(block_path, hilite_scheme)

Description

hilite_system(block_path) highlights a model object using colors specified by the default highlighting scheme. hilite_system(block_path, hilite_scheme) highlights a model object using the foreground and background colors specified in the highlighting scheme.

Tips

Input Arguments

block_path

A string in two possible formats:

  • A full block path

  • A traceability tag from the comments of Simulink Coder generated code. Using a traceability tag requires a Simulink Coder license. In this case, the format is <system>/block_name:

    • system is one of the following:

      • The string Root.

      • A unique system number assigned by the Simulink engine.

    • block_name is the name of the source block. If a block name contains a newline character (\n), in the block path string, replace the newline character with a space.

hilite_scheme

String identifying a highlighting scheme name. For more information, see Highlighting Scheme.

Definitions

Highlighting Scheme

A highlighting scheme specifies the foreground and background colors for a model object. Possible highlighting scheme names are:

default
none (clears the highlighting for an object)
find
unique
different
user1
user2
user3
user4
user5

You can alter the specification for a highlighting scheme by using the following command:

set_param(0, 'HiliteAncestorsData', HILITE_DATA)

HILITE_DATA is a MATLAB structure array with the following fields:

Color

The supported color strings for foreground and background colors are:

black
white
gray
red
orange
yellow
green
darkGreen
blue
lightBlue
cyan
magenta

Examples

For sldemo_f14.mdl use the block path to highlight the Controller block.

hilite_system('sldemo_f14/Controller')

In the model diagram, the Controller block is highlighted yellow.

 

If you have a Simulink Coder license, you can trace generated code to the corresponding source system or block in a model:

  1. Generate code for the rtwdemo_f14 model.

  2. In an editor or within an HTML code generation report, open a generated source or header file.

  3. As you review lines of code, note traceability tags that correspond to code of interest. To highlight a block using a traceability tag, enter:

     hilite_system('<Root>/alpha (rad)')
    

    The following figure shows block alpha (rad) highlighted.

    You can also use the hilite_system command to highlight a block within a subsystem. Specify the Aircraft Dynamics Model subsystem using its traceability tag.

    hilite_system('<S1>/Transfer Fcn.2')

See Also

rtwtrace

  


Related Products & Applications

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

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