sltrace.Graph
Description
An sltrace.Graph
object stores tracing information generated by the
sltrace
function.
Creation
You can create sltrace.Graph
object using the sltrace
function.
Properties
TraceGraph
— Tracing graph with edges and nodes
digraph
Tracing graph with edges and nodes, returned as a digraph
object. A node in the graph is decided by a block port on the
tracing path and shown as 'NodeIndex'
. For each node,
TraceGraph.Nodes
provides a table with more details, including
Block
, PortNumber
and
PortType
. If 'BlockPath'
is set to
'on'
in sltrace
, then the
Block
column of the TraceGraph.Nodes
table will
be shown as Simulink.BlockPath
.
TraceGraph.Edges
shows a table that contains the
EndNodes
of the digraph
object, and the Segments
between them.
Segments
is an array of segment handles that are connected together
to form a line between two blocks. If the EndNodes
belong to the same
block, their Segments
is marked as 'Internal'
. If
the end nodes are from connectionless block pairs, such as the pair formed by
'From'
and 'Goto'
, then their
Segments
is marked as 'Hidden'
.
SrcBlocks
, DstBlocks
— Blocks on the tracing path
array of block handles | Simulink.BlockPath
array
Blocks on tracing path, specified as an array of block handles or Simulink.BlockPath
objects. If tracing in the direction of source, source
blocks are returned in g.SrcBlocks
. If tracing in the direction of
the destination, destination blocks are returned in
g.DstBlocks
.
Object Functions
highlight | Highlight tracing results |
removeHighlight | Remove highlighted tracing results |
Examples
Trace All Sources in Model
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)
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)
Version History
Introduced in R2021b
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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)