Main Content

highlight

Highlight tracing results

Description

highlight(g) highlights all tracing results, blocks and lines in the sltrace.Graph object g.

example

highlight(g,target) highlights the blocks and lines specified in target.

Examples

collapse all

This example shows how to trace from the first inport of the block vdp/x1 to all sources.

open_system('vdp')
G = sltrace('vdp/x1', 'Source','Port', 1, 'TraceAll','on');

Highlight the tracing results and plot the trace graph.

highlight(G)

plot(G.TraceGraph)

Figure contains an axes object. The axes object contains an object of type graphplot.

Highlight the block vdp/Scope and the line connecting to the inport of vdp/Scope.

bh = get_param('vdp/Scope','Handle');
inportH = get_param('vdp/Scope','PortHandles').Inport;
lh = get_param(inportH,'line');
highlight(G,[bh, lh])

Remove the highlighting.

removeHighlight(G)

Input Arguments

collapse all

Graph created by sltrace function, specified as a sltrace.Graph object.

Specific items to highlight, specified as a block handle, a line handle, or an array of block and line handles.

Example: g.highlight([bh, seg]);

Introduced in R2021b