Main Content

probe

Display input, output, and state data for specified block in simulation debugging session

Description

example

probe blk displays in the MATLAB® Command Window information about the block specified by blk.

You can use this function in a simulation debugging session started:

  • Interactively, using the Simulink® Toolstrip

  • Programmatically, using the sldebug function

  • Programmatically, using the sim function with the 'debug' name-value argument

Note

This function is available only for simulation debugging sessions started programmatically and for interactive simulation debugging sessions while paused within a time step.

probe mdl blk displays information about the block specified by blk in the model specified by mdl.

probe level lvl sets the level of detail for the information displayed when you call the probe, trace, or disp functions in a simulation debugging session. By default, the software displays all information about the specified block, including input, output, state, and zero-crossing information.

Examples

collapse all

Open the model vdp.

openExample("simulink_general/VanDerPolOscillatorExample",...
    supportingFile="vdp.slx");

Start a simulation debugging session using the sldebug function. The MATLAB command prompt (>>) becomes the Simulink debugger prompt ((sldebug @0): >> ).

sldebug vdp
(sldebug @0): >> 

Use the probe function to view information about the current block.

probe gcb
probe: Data of Outport block 'vdp/Out2':
U1     = [0]

Use the step function to step to the start of the first major time step.

step top
%----------------------------------------------------------------%
[TM = 0                      ] vdp.Outputs.Major

In the block diagram, select the block Mu. Then use the probe function to view information about the currently selected block.

probe gcb
probe: Data of SubSystem block (virtual) 'vdp/Mu':
U1     = [0]
Y1     = [0]

When you have finished probing blocks, use the stop function to end the simulation debugging session.

stop

Input Arguments

collapse all

Block to probe, specified as one of these options:

  • (t)s:b — Display information about block in task with task ID t and system index s with block index b.

  • gcb — Display information for current block.

When you specify the name of the referenced model that contains the block, you must specify the block to register as a display point in the form (t)s:b.

Name of referenced model that contains block to probe, specified as a string or a character vector.

When you specify this argument, you must specify the block to register as a display point in the form (t)s:b.

Level of detail for information displayed, specified as one of these options:

  • all — Displays input and output values as well as information about states and zero crossings.

  • io — Displays only input and output values.

Tips

To start a simulation debugging session interactively, add one or more breakpoints to your model, and in the Breakpoints List, check that Pause within time step is selected. When the simulation pauses on a breakpoint, some of the programmatic debugging commands, such as the stop command, are available for use in the MATLAB Command Window.

Version History

Introduced in R2007a