File Exchange Pick of the Week

Our best user submissions

Conditional Breakpoint for Simulink models

Note

The file submission referenced in this post is no longer available on File Exchange.

IMHO, one of the most useful new features of MATLAB 7 for working with large applications was the introduction of conditional breakpoints. These allow you to have MATLAB enter debug mode based on what's going on in your code (a value crossing a threshold, for instance). This is a huge time saver, since it lets you stop your code execution exactly at the point of the behavior you are trying to understand.

 

While Simulink users have their own (very nice) debugger, they don't really have this capability. The closest is the STOP block that can force your model to stop executing if a certain condition occurs. Problem is, of course, that you can't resume your model. Don Orofino's Simulation Pause Block addresses this issue, by providing a conditional pause block for your Simulink models. Don gave a lot of flexibility with how you use the block. You can have it pause if it receives a non-zero signal or if a signal changes. You can also have it always pause (I found this useful to force my model to stop inside a triggered or enabled subsystem) or never pause (brilliant - you disable the condition without removing the block).

|
  • print
  • send email

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.