How can I control the simulation run time from m.file?
조회 수: 3 (최근 30일)
I have both the smulation file and the m.file. I need to run the simulink based on values from the m.file. But I also need to control the run time of the simulink. And the control needs to be done from the m.file. Is there any command to control the simulink run time from m.file? If so, What would be th syntex of it?
Esha Chakraborty 2022년 4월 12일
I understand that you want to control the simulation stop time programatically.
You can use the sim command to specify the StartTime and StopTime of the Simulink model programatically from the command line as given in the code below:
You can get further insights on the sim command here.
In case of an interactive simulation, you can also use the set_param command with multiple pairs of ParamaterName, Value arguments and StopTime parameter is just one of them.
set_param('modelname', 'StopTime', '3000')
More examples on set_param can be found here.