Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

sedb.breakpoints - Package: sedb

List breakpoints in discrete-event simulation

Syntax

breakpoints
b_struct = breakpoints

Description

breakpoints displays a list of all breakpoints in the simulation. The list includes disabled breakpoints, as well as breakpoints that the debugger already hit.

b_struct = breakpoints returns a structure array that stores information about breakpoints in the simulation.

Outputs

b_struct

Structure array that stores information about breakpoints. The following table describes the fields of each structure in the array.

FieldDescription
IDBreakpoint identifier
TypeType of breakpoint
ValueValue associated with the breakpoint, as a string
Enabled1, if the breakpoint is enabled; 0 otherwise

Examples

Set and view breakpoints:

  1. Begin a debugger session for a particular model. At the MATLAB command prompt, enter:

    sedebug('sedemo_timeout')
  2. Establish breakpoints and then view them in the Command Window. At the sedebug>> prompt, enter:

    tbreak 0.5
    tbreak 1
    tbreak 1.5
    breakpoints

    The output confirms the setting of breakpoints and displays the list of breakpoints:

    Set b1 : Breakpoint for first operation at or after time 0.500000
    
    Set b2 : Breakpoint for first operation at or after time 1.000000
    
    Set b3 : Breakpoint for first operation at or after time 1.500000
    
    
    List of Breakpoints: 
    
     ID        Type        Value       Enabled
     b1        Timed       0.5         yes
     b2        Timed       1           yes
     b3        Timed       1.5         yes
  3. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit
 

Manipulate the structure array that is the output from breakpoints:

  1. Begin a debugger session for a particular model. At the MATLAB command prompt, enter:

    sedebug('sedemo_timeout')
  2. Establish breakpoints and then record them in a structure variable. At the sedebug>> prompt, enter:

    tbreak 0.5
    tbreak 1
    tbreak 1.5
    b = breakpoints

    The output confirms the setting of breakpoints and displays an initial view of the structure b:

    Set b1 : Breakpoint for first operation at or after time 0.500000
    
    Set b2 : Breakpoint for first operation at or after time 1.000000
    
    Set b3 : Breakpoint for first operation at or after time 1.500000
    
    
    b = 
    
    1x3 struct array with fields:
        ID
        Type
        Value
        Enabled
  3. View information about the first breakpoint:

    b1 = b(1)

    The output is a structure:

    b1 = 
    
             ID: 'b1'
           Type: 'Timed'
          Value: '0.5'
        Enabled: 1
  4. Store the IDs of the enabled breakpoints in a cell array, bid:

    idx = find([b.Enabled]);
    bid = {b(idx).ID}

    The output is:

    bid = 
    
        'b1'    'b2'    'b3'
  5. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit

See Also

sedb.bdelete | sedb.disable | sedb.evbreak | sedb.tbreak

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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