hilite_system
R2026bHighlight block, signal line, or annotation
Description
Examples
Suppose you have a model named myModel. The model
contains an Integrator block named myBlock. A branched signal
line connects the output port of myBlock to multiple other blocks. Highlight
the signal line, including all branches.
In this example, you want to get the handle of a signal line, including all branches. You
can get the line handle by using the get_param function to query which
signal lines connect to a given block. If you query the block connected to the signal line at
the output port, the get_param function returns the handle of the entire
signal line, including all branches. If you query one of the blocks connected to the signal
line at the input port, the function returns the handle of the branch connected to that block.
In this example, you want to get the line handle of the entire signal line, so you want to
query the block connected to signal line at the output port.
Get the handles of all signal lines connected to the Integrator block.
hAll = get_param("myModel/myBlock","LineHandles");
Get the handle of the signal line connected to the output port of the Integrator block.
h = hAll.Outport;
Highlight the signal line, including all branches, in the default style.
hilite_system(h);
Suppose you have a model named myModel that containing
a block named myBlock1 and a block named myBlock2.
Highlight the blocks in the default style.
blockPaths = "myModel/"+["myBlock1";"myBlock2"]; hilite_system(blockPaths);
Highlight the blocks in the find style.
hilite_system(blockPaths,"find");Suppose you have a model named myModel containing a
highlighted block named myBlock.
Remove the highlighting from the block by setting the highlighting style to
none.
hilite_system("myModel/myBlock","none")
Alternatively, remove the highlighting interactively by pressing Ctrl+Shift+H. On macOS, press Command+Shift+H.
Suppose you have a model named myModel. The model
contains an Integrator block. A branched signal line connects the output port of
the Integrator block to multiple other blocks, including a block named
myBlock. Highlight the branch of the signal line connected to
myBlock.
In this example, you want to get the handle of the branch of a signal line. You can get
the line handle by using the get_param function to query which signal
lines connect to a given block. If you query the block connected to the signal line at the
output port, the get_param function returns the handle of the entire
signal line, including all branches. If you query one of the blocks connected to the signal
line at the input port, the function returns the handle of the branch connected to that block.
In this example, you want to get the line handle of a branch, so you want to query the block
connected to that branch at the input port.
Get the handles of all signal lines connected to myBlock.
hAll = get_param("myModel/myBlock","LineHandles");
Get the handle of the signal line connected to the input port of
myBlock.
h = hAll.Inport;
Highlight the branch of the signal line connected to myBlock in the
default style.
hilite_system(h);
Suppose you have a model named myModel. In the model,
highlight all annotations containing the word note.
Get the handles of all annotations containing the word note.
h = find_system("myModel",FindAll="on",Regexp="on",CaseSensitive="off",Name=".*note.*");
Highlight the annotations in the default style.
hilite_system(h);
You can customize a highlighting style by setting the value of the
HiliteAncestorsData parameter on the root-level model using the
set_param function.
set_param(0,HiliteAncestorsData=hiliteData)
Specify hiliteData as a structure array with 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'
Customize the debug highlighting style.
myHiliteData = struct(HiliteType='debug',ForegroundColor='darkBlue',BackgroundColor='magenta'); set_param(0,HiliteAncestorsData=myHiliteData);
Suppose you have a model named myModel containing a block named
myBlock. Highlight the block using the customized debug style.
hilite_system("myModel/myBlock","debug");
If you have a Simulink® Coder™ license, you can trace generated code to the corresponding source block in a model.
Open the RollAxisAutopilot model.
openExample("ecoder/GettingStartedEcoderExample") open_system("RollAxisAutopilot");
Generate code for the model. In the Simulink® Toolstrip, on the Apps tab, under Code Generation, click Embedded Coder. The C Code tab appears in the toolstrip. On the C Code tab, 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>/Turn_Knob")Highlight a block in a subsystem.
hilite_system("<S1>/RateGain")
Input Arguments
One or more blocks, signal lines, or annotations to highlight, specified as one of these:
Handles
To highlight a signal line, specify either the handle of the signal line or the handle of a port connected to the signal line.
Block paths, formatted as a string, string array, character vector, or cell array of character vectors.
Simulink.BlockPathobjectsSimulink identifiers
Traceability tags from the comments of Simulink Coder generated code
Using a traceability tag requires a Simulink Coder license.
For information about getting handles and paths, see Get Handles and Paths.
The format for a traceability tag is <model>/block, where
model is either:
RootUnique model number assigned by Simulink during code generation
Example: "myModel/myBlock"
Example: ["myModel/myBlock1","myModel/myBlock2"]
Example: "<Root>/myBlock"
Data Types: double | array of doubles | string | string array | character vector | cell array of character vectors | Simulink.BlockPath object
Highlighting style, specified as one of these values. You can customize the appearance of any of the styles. See Highlight Using a Custom Style.
"default"— Default color scheme: red outline, yellow fill."none"— Clears the highlight.To clear all highlighting, press Ctrl+Shift+H. On macOS, press ⌘+Shift+H instead.
"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"
Data Types: string | character vector
Version History
Introduced before R2006a
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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)