Open a parameterization script from simulink

2 次查看(过去 30 天)
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?

采纳的回答

Christopher Wallace
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by