| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimEvents |
| Contents | Index |
| Learn more about SimEvents |
| On this page… |
|---|
If you want to execute one or more commands in the debugger immediately after initializing the model, you can include those commands when you invoke sedebug. You might find executing commands automatically to be useful for setting the same breakpoints or detail settings across multiple debugging sessions, or helping someone reproduce a problem that you are seeing in a model.
To start a debugger session that executes commands automatically:
Create an empty options structure using the se_getdbopts function.
opts_struct = se_getdbopts;
Define the StartFcn field of the options structure as a cell array of strings, where each string is an individual command that you want to execute after initializing the model. Here is an example:
opts_struct.StartFcn = {'detail(''cal'',1)', 'tbreak 5'};Start a debugger session using the sedebug function with the options structure as the second input argument. Here is an example:
sedebug('sedemo_event_priorities', opts_struct)End the debugger session. At the sedebug>> prompt, enter:
sedb.quit
For an example, see the se_getdbopts reference page.
If you want to execute commands and then exit the debugging session automatically, include the string 'quit' at the end of the StartFcn array. If you want to execute commands automatically and then interact with the debugger, do not include the string 'quit' in the StartFcn array.
If you want to set breakpoints at the beginning of the debugging session, have just ended a debugging session on the same model and have not changed the model, you can use the identifiers that occurred in the previous debugging session.
If you use a particular debugger command frequently, such as step or step over, a shortcut you can click might provide an efficient way to issue the command repeatedly. To learn about shortcuts, see Running Frequently Used Statement Groups with MATLAB Shortcuts.
![]() | Customizing the Debugger Simulation Log | Defining a Breakpoint | ![]() |

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