| Contents | Index |
List breakpoints in discrete-event simulation
breakpoints
b_struct = breakpoints
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.
Set and view breakpoints:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_timeout')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.5 Set b2 : Breakpoint for first operation at or after time 1 Set b3 : Breakpoint for first operation at or after time 1.5 List of Breakpoints: ID Type Value Enabled b1 Timed 0.5 yes b2 Timed 1 yes b3 Timed 1.5 yes
End the debugger session. At the sedebug>> prompt, enter:
sedb.quit
Manipulate the structure array that is the output from breakpoints:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_timeout')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.5
Set b2 : Breakpoint for first operation at or after time 1
Set b3 : Breakpoint for first operation at or after time 1.5
b =
1x3 struct array with fields:
ID
Type
Value
Enabled
View information about the first breakpoint:
b1 = b(1)
The output is a structure:
b1 =
ID: 'b1'
Type: 'Timed'
Value: '0.5'
Enabled: 1
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'
End the debugger session. At the sedebug>> prompt, enter:
sedb.quit
sedb.bdelete | sedb.blkbreak | sedb.disable | sedb.evbreak | sedb.tbreak

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |