MATLAB: How to change the Enable debugging/animation option within the Simulation Target using the Stateflow API

animationapidebuggingsimulationstateflowtarget

I would like to change the Enable debugging/animation option within the Simulation Target using the Stateflow API.

Best Answer

rt=sfroot;
m=rt.find('-isa','Stateflow.Machine');
x = m.find('-isa','Stateflow.Target');
x.setCodeFlag('debug',1); - to enable debugging/animation
x.setCodeFlag('debug',0); - to disable debugging/animation