| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimEvents |
| Contents | Index |
| Learn more about SimEvents |
Current time in discrete-event simulation
t = simtime
t = simtime, at the SimEvents debugger command prompt, returns the current simulation time.
Set a breakpoint to advance the simulation by 2 s from the current time:
Begin a debugger session for a particular model. At the MATLAB command prompt, enter:
sedebug('sedemo_count_attributes')Use the current time to set a breakpoint. At the sedebug>> prompt, enter:
t = simtime; tbreak(t+2)
The following output confirms the setting of the breakpoint:
Set b1 : Breakpoint for first operation at or after time 2.000000
Run the simulation until the breakpoint:
cont
The output describes simulation behavior and then confirms that the debugger has reached the breakpoint. Here is an excerpt:
Hit b1 : Breakpoint for first operation at or after time 2.000000 %==============================================================================% Executing EntityGeneration Event (ev3) Time = 2.000000000000000 : Entity = <none> Priority = 1 : Block = Time-Based Entity Generator
End the debugger session. At the sedebug>> prompt, enter:
sedb.quit
![]() | sedb.runtoend | sedb.step | ![]() |

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 |