How can I invoke the Simulink debugger from within a MATLAB script and issue subsequent debugger commands in Simulink 7.5 (R2010a)?

4 views (last 30 days)
I want to start the Simulink debugger from within a MATLAB script, and issue debugger commands subsequently. However, I see that once I invoke the SLDEBUG command within my script, control transfers to the debugger prompt, and I am unable to issue debugger commands from within the script.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 23 Mar 2011
You can use either of the following two approaches to call SLDEBUG on a model from within a script, and subsequently execute debugger commands.
Approach 1: Create a cell array of commands that you want to execute in debug mode, and then call the SIM command with the cell array as an argument.
cmds = {'slist','step top','step top','stop'};
sim('vdp','debug',cmds);
Approach 2: Create a SIMSET, a cell array consisting debugger commands, and then pass the SIMSET as an argument to the SIM command.
cmds = {'slist','step top','step top','stop'};
opts = simset('debug',cmds);
sim('vdp',[],opts);
Note, however, that the SIMSET feature may be deprecated in a future release of MATLAB.

More Answers (0)

Categories

Find more on Chemistry in Help Center and File Exchange

Products


Release

R2010a

Community Treasure Hunt

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

Start Hunting!