Open a parameterization script from simulink

2 vues (au cours des 30 derniers jours)
Thomas McNEil
Thomas McNEil le 6 Juin 2018
Commenté : Thomas McNEil le 6 Juin 2018
I am new to simulink, so I started going through the examples. One I found, is pe_dc_motor_control. When I run this in the command window, a simulink model opens from the following directory. C:\Program Files\MATLAB\R2017b\toolbox\physmod\pe\pedemos The simulink model is : pe_dc_motor_control.slx When it runs, many variables are loaded into the workspace from a .m file, named pe_dc_motor_control_data.m. Without these variables being loaded, the simulink model will not run. I cannot locate in the Simulink model where this file is called out to load. I do not see any user-defined functions-> matlab blocks or S-Functions in the Simulink model that calls this script out to be loaded in the workspace. In the text block, pe_dc_motor_control_data.m is referred to as the Associated Parameterization Script, but I can't find a reference to it in the Simulink model other than that hyperlink. Can you explain how this file gets called?

Réponse acceptée

Christopher Wallace
Christopher Wallace le 6 Juin 2018
Hi Thomas,
The data file is being loaded in the PreLoadFcn callback within the Model Properties. There is a number of ways to open the callbacks, one of them is to right click on the whitespace in the model and select "Model Properties". From there you should see a tab labeled "Callbacks" which will list the available callbacks for the model. PreLoadFcn will have an asterisks next to it indicating that changes have been made.
Best Regards,
Chris
  1 commentaire
Thomas McNEil
Thomas McNEil le 6 Juin 2018
Thank you, that was exactly what I needed.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by