필터 지우기
필터 지우기

Open a parameterization script from simulink

조회 수: 2 (최근 30일)
Thomas McNEil
Thomas McNEil 2018년 6월 6일
댓글: Thomas McNEil 2018년 6월 6일
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
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
  댓글 수: 1
Thomas McNEil
Thomas McNEil 2018년 6월 6일
Thank you, that was exactly what I needed.

댓글을 달려면 로그인하십시오.

추가 답변 (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