MATLAB Answers

0

Change referenced model simulation mode programmatically

Asked by Jonathan Drolet on 17 Oct 2017
Latest activity Answered by Aveek Podder on 20 Oct 2017
I have a complex model involving multiple referenced models in "Accelerator" simulation mode.
I want to do model coverage on all models, which requires having the "Normal" simulation mode.
I am looking for a way to recursively change the simulation mode of every referenced model to "Normal" prior to running the simulation. Ideally, something similar to Simulink.BlockDiagram.buildRapidAcceleratorTarget would be best.
Thanks,
Jonathan

  0 Comments

Sign in to comment.

1 Answer

Answer by Aveek Podder on 20 Oct 2017

Hi,
You can use 'set_param' command to change the simulation mode of the model.
The following command can be used to set the simulation mode of the model.
set_param('modelname','SimulationMode','mode')
For more information on programmatic interaction with the Acceleration modes, please go through the following link: https://www.mathworks.com/help/simulink/ug/interacting-with-the-acceleration-modes-programmatically.html

  0 Comments

Sign in to comment.