hilite_system
Highlight block, signal line, port, or annotation
Description
hilite_system(
highlights a
block, line, port, or annotation in an open model using the default
highlight style. Use obj
)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.
Examples
Highlight Block Using Default Highlight Style
Open the model
slexAircraftExample
.
openExample('slexAircraftExample')
Highlight the Controller block. When you use the default highlight style, the block appears highlighted with a red outline and yellow fill.
hilite_system('slexAircraftExample/Controller')
Highlight a Block Using a Highlight Style
Open the model vdp
.
vdp
Highlight the Mu block using the style
'fade'
.
hilite_system('vdp/Mu','fade')
Use Block Highlighting to Trace Generated Code
If you have a Simulink® Coder™ license, you can trace generated code to the corresponding source block in a model.
Open the model f14
.
f14
In the model configuration parameters, in the
Solver pane, set
Type to
Fixed-step
.
Generate code for the model. In the Apps tab, under Code Generation, click Embedded Coder. The C Code tab appears. Click Build.
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')
Customize a Highlighting Style
You can customize a highlighting style by setting
the 'HiliteAncestorsData'
parameter on the
root-level model using set_param
in this
form:
set_param(0,'HiliteAncestorsData',hiliteData)
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'
.
set_param(0,'HiliteAncestorsData',... struct('HiliteType','user1',... 'ForegroundColor','darkGreen',... 'BackgroundColor','lightBlue')); set_param(0,'HiliteAncestorsData',... struct('HiliteType','debug',... 'ForegroundColor','red',... 'BackgroundColor','black'));
Use the defined style to highlight a block.
f14 hilite_system('f14/Controller/Alpha-sensor Low-pass Filter','user1')
Input Arguments
obj
— Block, port, line, or annotation to highlight
block path name | Simulink.BlockPath
object | numeric handle | Simulink identifier | traceability tag
Block, port, line, or annotation to highlight, specified as:
The full block path name
A
Simulink.BlockPath
objectA numeric handle for lines, ports, or annotations
Simulink identifier
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'
,
'vdp:3'
,
'<Root>/Mu'
style
— Highlighting style
'default'
(default) | character vector
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, in the Signal tab, click Remove Trace.
'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'
Version History
Introduced before R2006a
See Also
rtwtrace
(Embedded Coder) | find_system
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)