SimEvents debugger options structure


opts_struct = se_getdbopts


opts_struct = se_getdbopts returns an empty options structure that you can configure and then use as an input to the sedebug function. You can set the StartFcn field of opts_struct to a cell array of strings representing commands that the debugger executes after the debugger session begins.

Output Arguments


Structure that describes options for a SimEvents® debugger session. The StartFcn field of the structure is a cell array of strings.


Set breakpoints upon starting the debugger:

  1. At the MATLAB® command prompt, create an options structure to use in future debugger sessions:

    opts_struct = se_getdbopts;
    opts_struct.StartFcn = {'tbreak 1', 'tbreak 2'};
  2. For a particular model, begin a debugger session using a syntax that includes opts_struct as an input argument. Using this argument causes the debugger to execute the commands in the opts_struct.StartFcn field automatically:

    sedebug('sedemo_outputswitch', opts_struct)

    The output in the MATLAB Command Window reflects model initialization followed by the setting of two breakpoints:

    *** SimEvents Debugger ***
    Functions | Help | Watch Video Tutorial
    Initializing Model sedemo_outputswitch
    Set b1 : Breakpoint for first operation at or after time 1
    Set b2 : Breakpoint for first operation at or after time 2
  3. Proceed in the simulation until the first breakpoint. At the sedebug>> prompt, enter:


    The output is:

    Initializing Time-Based Entity Generators
        Scheduling EntityGeneration Event (ev1)
        : EventTime = 1.000000000000000
        : Priority  = 500
        : Entity    = <none>
        : Block     = Time-Based Entity Generator
    Hit b1 : Breakpoint for first operation at or after time 1
    Executing EntityGeneration Event (ev1)                Time = 1.000000000000000
    : Entity = <none>                                     Priority = 500
    : Block  = Time-Based Entity Generator
  4. End the debugger session. At the sedebug>> prompt, enter:


See Also

Was this topic helpful?