Displaying Information About the Model

Displaying a Models Sorted Lists

In GUI mode, the debugger Sorted List pane displays lists of blocks for a models root system and each nonvirtual subsystem. Each list lists the blocks that the subsystems contains sorted according to their computational dependencies, alphabetical order, and other block sorting rules. In command-line mode, you can use the slist command to display a model's sorted lists.

---- Sorted list for 'vdp' [12 blocks, 9 nonvirtual blocks, 
directFeed=0]
  0:0    'vdp/Integrator1' (Integrator)
  0:1    'vdp/Out1' (Outport)
  0:2    'vdp/Integrator2' (Integrator)
  0:3    'vdp/Out2' (Outport)
  0:4    'vdp/Fcn' (Fcn)
  0:5    'vdp/Product' (Product)
  0:6    'vdp/Mu' (Gain)
  0:7    'vdp/Scope' (Scope)
  0:8    'vdp/Sum' (Sum)

These displays include the block index for each command. You can use them to determine the block IDs of the models blocks. Some debugger commands accept block IDs as arguments.

Identifying Blocks in Algebraic Loops

If a block belongs to an algebraic list, the slist command displays an algebraic loop identifier in the entry for the block in the sorted list. The identifier has the form

algId=s#n

where s is the index of the subsystem containing the algebraic loop and n is the index of the algebraic loop in the subsystem. For example, the following entry for an Integrator block indicates that it participates in the first algebraic loop at the root level of the model.

0:1 'test/ss/I1' (Integrator, tid=0) [algId=0#1, discontinuity]

You can use the debugger ashow command to highlight the blocks and lines that make up an algebraic loop. See Displaying Algebraic Loops for more information.

Displaying a Block

To determine the block in a models diagram that corresponds to a particular index, enter bshow s:b at the command prompt, where s:b is the block index. The bshow command opens the system containing the block (if necessary) and selects the block in the systems window.

Displaying a Models Nonvirtual Systems

The systems command displays a list of the nonvirtual systems in the model that you are debugging. For example, the clutch demo (clutch) contains the following systems:

sldebug clutch
[Tm=0                      ] **Start** of system 'clutch' outputs
(sldebug @0:0 'clutch/Clutch Pedal'): systems
 0   'clutch'
 1   'clutch/Locked'
 2   'clutch/Unlocked'

Displaying a Model's Nonvirtual Blocks

The slist command displays a list of the nonvirtual blocks in a model. The listing groups the blocks by system. For example, the following sequence of commands produces a list of the nonvirtual blocks in the Van der Pol (vdp) demo model.

sldebug vdp
[Tm=0                      ] **Start** of system 'vdp' outputs
(sldebug @0:0 'vdp/Integrator1'): slist
---- Sorted list for 'vdp' [12 blocks, 9 nonvirtual blocks, 
directFeed=0]
  0:0    'vdp/Integrator1' (Integrator)
  0:1    'vdp/Out1' (Outport)
  0:2    'vdp/Integrator2' (Integrator)
  0:3    'vdp/Out2' (Outport)
  0:4    'vdp/Fcn' (Fcn)
  0:5    'vdp/Product' (Product)
  0:6    'vdp/Mu' (Gain)
  0:7    'vdp/Scope' (Scope)
  0:8    'vdp/Sum' (Sum)

Displaying Blocks with Potential Zero Crossings

The zclist command displays a list of blocks in which nonsampled zero crossings can occur during a simulation. For example, zclist displays the following list for the clutch sample model:

(sldebug @0:0 'clutch/Clutch Pedal'): zclist
  2:3    'clutch/Unlocked/Sign' (Signum)
  0:4    'clutch/Lockup Detection/Velocities Match' (HitCross)
  0:10   'clutch/Lockup Detection/Required Friction 
           for Lockup/Abs' (Abs)
  0:11   'clutch/Lockup Detection/Required Friction for  
           Lockup/ Relational Operator' (RelationalOperator)
  0:18   'clutch/Break Apart Detection/Abs' (Abs)
  0:20   'clutch/Break Apart Detection/Relational Operator' 
           (RelationalOperator)
  0:24   'clutch/Unlocked' (SubSystem)
  0:27   'clutch/Locked' (SubSystem)

Displaying Algebraic Loops

The ashow command highlights a specified algebraic loop or the algebraic loop that contains a specified block. To highlight a specified algebraic loop, enter ashow s#n, where s is the index of the system (see Identifying Blocks in Algebraic Loops) that contains the loop and n is the index of the loop in the system. To display the loop that contains the currently selected block, enter ashow gcb. To show a loop that contains a specified block, enter ashow s:b, where s:b is the block's index. To clear algebraic-loop highlighting from the model diagram, enter ashow clear.

Displaying Debugger Status

In GUI mode, the debugger displays the settings of various debug options, such as conditional breakpoints, in its Status panel. In command-line mode, the status command displays debugger settings. For example, the following sequence of commands displays the initial debug settings for the vdp model:

sim('vdp',[0,10],simset('debug','on'))
[Tm=0                      ] **Start** of system 'vdp' outputs
(sldebug @0:0 'vdp/Integrator1'): status
  Current simulation time: 0 (MajorTimeStep)
  Last command: ""
  Stop in minor times steps is disabled.
  Break at zero crossing events is disabled.
  Break when step size is limiting by a state is disabled.
  Break on non-finite (NaN,Inf) values is disabled.
  Display of integration information is disabled.
  Algebraic loop tracing level is at 0.
  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS