sltrace
Description
traces a
signal oriented from the port g
= sltrace(p
)p
and stores the results in the sltrace.Graph
object g
.
traces a signal using one or more g
= sltrace(___, Name,Value
)Name,Value
arguments.
Examples
Trace all sources in model
Trace from the first inport of 'vdp/Scope'
to all
sources.
vdp g = sltrace('vdp/Scope', 'Source', 'Port', 1, 'TraceAll','on')
g = Graph with properties: SrcBlocks: [2.0001 5.0001 6.0001 7.0001 9.0001 10.0001 11.0001 12.0001 13.0001] DstBlocks: [] TraceGraph: [1×1 digraph]
Trace using block path
Trace from the second inport handle of 'vdp/Sum'
to Stop block 'vdp/Product'
and display the results in
Simulink.BlockPath
format.
bPort = get_param('vdp/Sum', 'PortHandles').Inport(2); G = sltrace(bPort, 'Stop', 'vdp/Product', 'BlockPath','On');
Input Arguments
p
— Block port
port handle
Block port where tracing begins, specified as a port handle.
block
— Block where tracing begins
block name | block handle | Simulink.BlockPath
Block where tracing begins, specified as a block name, block handle, or as Simulink.BlockPath
object.
direction
— Direction of traced signal
'Source'
| 'Destination'
Direction of traced signal, specified as either 'Source'
or
'Destination'
.
Data Types: char
| string
Name-Value Arguments
Example: 'TraceAll','on','BlockPath','on'
Specify optional
Name,Value
arguments, where Name
is the argument
name and Value
is the corresponding value. Name
must
appear inside quotes. You can specify several name and value pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
TraceAll
— Trace to all sources and destinations
off (default) | on
Trace to all sources or destinations, specified as 'off'
or
'on'
. By default, tracing stops at the first non-virtual block.
Set this argument to 'on'
to trace to all sources or destinations.
Example: 'TraceAll','on'
Stop
— Block where tracing stops
block name | block handle | Simulink.BlockPath
Block where tracing stops, specified as a block name, block handle, or as Simulink.BlockPath
object. If the block where tracing stops is not on the
tracing path, sltrace
traces to all blocks.
Example: 'Stop','vdp/Sum'
Port
— Port where tracing begins
real positive scalar
Port where tracing begins, specified as a real positive scalar. When tracing from
a block with multiple inports or outports, you can enable the
'Port'
option to select a specific port to trace from. Without
enabling 'Port'
, sltrace
will trace from
all inports or outports. You can omit 'Port'
when tracing from a
block port handle.
Example: 'Port','2'
Data Types: double
| single
Element
— Bus element where tracing begins
bus element name
Bus element where tracing begins. sltrace
supports
tracing to the source from a Bus Creator block and tracing to a destination from a Bus
Selector block. You do not need to specify this parameter if tracing from block port
handle p
.
Example: 'Element','b'
Data Types: char
| string
BlockPath
— Option to return tracing information as Simulink.BlockPath
'off'
(default) | 'on'
Option to return tracing information as Simulink.BlockPath
object, specified as 'off'
or 'on'
. If there are
multiple instances of a referenced model, set 'BlockPath'
to
'on'
to obtain accurate tracing results for different model
instances.
Output Arguments
g
— Tracing results
sltrace.Graph
object
Tracing result, returned as a sltrace.Graph
object.
Version History
Introduced in R2021b
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)