| Contents | Index |
hilite_system(block_path)
hilite_system(block_path, hilite_scheme)
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.
Calling hilite_system does not clear highlighted objects from previous hilite_system calls.
Using a traceability tag for block_path requires a Simulink Coder license. If you call hilite_system with a traceability tag as input, do the following:
If you closed and reopened a model, you must update the model before calling hilite_system.
If you changed your model, such as adding a block to your diagram, before calling hilite_system, generate new code for the model. When the system hierarchy of the model changes, traceability tags change. If you use a traceability tag from previously generated code, hilite_system might highlight the wrong block.
If a block name contains a newline character (\n), it is replaced with a space for readability. When calling hilite_system, in the block path string, replace the newline character with a space.
hilite_system might not work for a block, if the block name contains:
A single quote (').
An asterisk (*), that causes a name-mangling ambiguity relative to other names in the model. This name-mangling ambiguity occurs in a block name or at the end of a block name if an asterisk precedes or follows a slash (/).
The character ÿ (char(255)).
block_path |
A string in two possible formats:
|
hilite_scheme |
String identifying a highlighting scheme name. For more information, see 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:
'HiliteType': string specifying a highlighting scheme.
'ForegroundColor': string specifying a foreground Color.
'BackgroundColor': string specifying a background Color.
The supported color strings for foreground and background colors are:
| black |
| white |
| gray |
| red |
| orange |
| yellow |
| green |
| darkGreen |
| blue |
| lightBlue |
| cyan |
| magenta |
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:
Generate code for the rtwdemo_f14 model.
In an editor or within an HTML 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. 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')


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 |