Effacer les filtres
Effacer les filtres

How to set "Pause simulation when time reaches " parameter through s“set_param”

20 vues (au cours des 30 derniers jours)
Cc
Cc le 30 Nov 2021
Commenté : Cc le 1 Déc 2021
I want to change this parameter "Pause simulation when time reaches " dynamically in the process of running the program through the “set_param” funtion in the M -file,such as "set_param('**.mdl','SimulationCommand','step')",but I do not know the corresponding parameter name, how to achieve it?

Réponse acceptée

Arpan Bhowmik
Arpan Bhowmik le 1 Déc 2021
It is my understanding that you are trying to set the pause time for a simulation using the command line.
The commandline parameter name for the “Pause simulation when time reaches” setting is “EnablePauseTimes”, while the parameter name for the actual pause times is “PauseTimes”. You can use these parameter names with set_param to set the appropriate model parameters.
To enable the pause times programmatically (equivalent to selecting the check-box in the GUI), the command is:
set_param(modelNam,'EnablePauseTimes','on');
To set the pause-times to a workspace variable named ‘set_time’, the command is:
set_param(modelName,'PauseTimes','set_time');
You can also accomplish both settings in a single set_param call as follows:
set_param(modelName,'EnablePauseTimes','on','PauseTimes','set_time');
  1 commentaire
Cc
Cc le 1 Déc 2021
Thank you for your answer! It helped me solve the problem very well.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by