MATLAB Answers

Best practice and general discussion on debuggin in Simulink ...

1 view (last 30 days)
Song on 19 May 2016
Hi, one of topics on Simulink programming and Model-based programming which kind of confuses me is debugging.
On the one side, Simulink has all programming elements, eg. for, if, while, selectors, matrix calculators etc., in its disposal to build a real program graphically that could be done only in text-based IDE before. On the other side, I still find the debugging is one of the handicaps of model-based design comparing to text-form programming. For example, I a IDE like Visual Studio or Eclipse, I can set a normal breakpoint or conditional breakpoint, then use next step to check the calculation line by line. Also I can take look at the variable values in a memory "watcher" any time during debugging. This is really a best proven method in practice.
I believe years ago Mathworks has also seen the need for the same possibility in Simulink. Since 2013b one can set conditional breakpoint directly to signal line like programming in IDE (but why always combined with a condition??). Also the new feature "Data Display in Simulation" either by click on line or hovering is introduced. Both features are really good and great improvements comparing to the previous Simulink Debugger. But still I miss a simple and more "intuitive" way with "Step Over(F10), Step In (F11), Run(F5)", and a central place like "watcher", where I can see the values of all interested variables at every step. A lot of my working colleagues have turned back to model-based back and switched to traditional programming environment, just because they find that debugging is too difficult, besides the much bigger effort to build-up a model.
I don't know how you see this topic and how you are currently handling the debugging, eg. stepping with breakpoints and checking real-time values. Hopefully everyone can share their experience and their practice during model-based design to help all.
Thank you indeed

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!