Effacer les filtres
Effacer les filtres

How to run a simulink model using a program? what is the command used?

3 vues (au cours des 30 derniers jours)
Susmita
Susmita le 18 Fév 2012
Sim command is generally used....I am confused how it is used....how the values produced from the program are transfered to the simulink model.

Réponse acceptée

TAB
TAB le 18 Fév 2012
sim('YourModel');
OR
set_param('YourModel', 'SimulationCommand', 'start');
Using set_param('YourModel', 'SimulationCommand', ...) you can start, stop, pause or continue the simulation.
  3 commentaires
TAB
TAB le 20 Fév 2012
"where a = arr(1,1); arr() is an arg of the function"
Didn't understand - arr() is an arg of the function.
for "set_param('newmodel/PID','KP','a')" a should be present on base workspace.
Kaustubha Govind
Kaustubha Govind le 20 Fév 2012
You need to set the SrcWorkspace parameter as described here: http://www.mathworks.com/matlabcentral/answers/10149-simulink-workspace
By default, Simulink looks for the parameter variables in the base workspace. Setting SrcWorkspace to 'current' forces it to use the current (function) workspace instead.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Event Functions 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