Open a parameterization script from simulink
1 次查看(过去 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?
0 个评论
采纳的回答
Christopher Wallace
2018-6-6
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 Center 和 File Exchange 中查找有关 Programmatic Model Editing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!