This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Highlight block, signal line, port, or annotation





hilite_system(obj) highlights a block, line, port, or annotation in an open model using the default highlight style. Use hilite_system with a port to highlight the signal line attached to the port. Each use of hilite_system adds to the highlighting. Highlighting is not saved with the model.


hilite_system(obj,style) uses the specified highlighting style.

Input Arguments

collapse all

Block, port, line, or annotation to highlight, specified as:

  • The full block path name

  • A numeric handle for lines, ports, or annotations

  • A traceability tag from the comments of Simulink® Coder™ generated code.

    Using a traceability tag requires a Simulink Coder license.

The format for a traceability tag is <system>/block, where system is either:

  • Root

  • A unique system number assigned by Simulink during code generation

Example: 'vdp/Mu', 'sldemo_fuelsys/fuel_rate_control/airflow_calc', '<Root>/Mu'

Highlighting style, specified as one of these values. You can customize the appearance of any of the styles. See Customize a Highlighting Style.

  • 'default' — Default color scheme: red outline, yellow fill.

  • 'none' — Clears the highlight.

    To clear all highlighting, in the Simulink Editor, select Display > Remove Highlighting.

  • 'debug' — Uses default color scheme.

  • 'different' — Applies red outline, white fill.

  • 'error' — Uses default color scheme.

  • 'fade' — Applies gray outline, white fill.

  • 'find' — Applies dark blue outline, blue fill.

  • 'lineTrace' — Applies red outline, blue fill.

  • 'unique' — Dark blue outline, white fill.

  • 'user1', 'user2', 'user3', 'user4', 'user5' — Applies custom highlight: black outline, white fill by default (i.e., no highlight).

In addition, you can use these color schemes. The first word is the outline and the second is the fill color.

  • 'orangeWhite'

  • 'blackWhite'

  • 'redWhite'

  • 'blueWhite'

  • 'greenWhite'


collapse all

Open the model slexAircraftExample.


Highlight the Controller block. When you use the default highlight style, the block appears highlighted with a red outline and yellow fill.


Open the model vdp.


Highlight the Mu block using the style 'fade'.


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

Open the model f14.


In the model configuration parameters, in the Solver pane, set Type to Fixed-step.

Generate code for the model using Code > C/C++ Code > Build Model.

In an editor or in the code generation report, open a generated source or header file. As you review lines of code, note traceability tags that correspond to code of interest.

Highlight a block using a traceability tag.

hilite_system('<Root>/Stick Input')

Highlight a block in a subsystem.

hilite_system('<S3>/W-gust model')

You can customize a highlighting style by setting the 'HiliteAncestorsData' parameter on the root-level model using set_param in this form:


Specify hiliteData as a structure array that has these fields:

  • 'HiliteType' — Highlighting style to customize, such as 'user1', 'debug', or 'error'.

  • 'ForegroundColor' — Color for block fill.

  • 'BackgroundColor' — Color for block outline.

The supported values for 'ForegroundColor' and 'BackgroundColor' are:

  • 'black'

  • 'white'

  • 'gray'

  • 'red'

  • 'orange'

  • 'yellow'

  • 'green'

  • 'darkGreen'

  • 'blue'

  • 'lightBlue'

  • 'cyan'

  • 'magenta'

Define a highlight style for 'user1', and customize the style for 'debug'.


Use the defined style to highlight a block.

hilite_system('f14/Controller/Alpha-sensor Low-pass Filter','user1')

Introduced before R2006a

Was this topic helpful?