How can I customize the function prototype of the "step" routine (modelname_step()) in the generated code in MATLAB R2012b?

조회 수: 5 (최근 30일)
When I generated code from my Simulink model the entry point functions in the generated code appear as "modelname_step()" function, with no arguments.
However, I want to change the name of this entry point function to "modelname_run()". I also want the function prototype to include all of the bus structures that I've defined into and out of the model.
How can I accomplish this?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 5월 24일
편집: MathWorks Support Team 2024년 5월 24일
"model_step()" and is the default name of the step routine in the code generated from a Simulink model. If you use Embedded Coder, you can customize this code interface appearance in the generated code. This means the System Target File should be set to ert.tlc.
Follow the steps below to customize the generated code for this use case:
1. Go to Configuration Parameters -> Code Generation-> Interface.
2. In this pane, go to the section titled “Code Interface” and click on “Configure Model Functions” button to open the “Model Interface” window.
3. Change the Function Specification field to “Model specific C Prototypes”.
4. Hit 'Get Default Configuration'
5. Now configure the names of the “step” function and the arguments of the “step” function to include all relevant input/output structures.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

제품


릴리스

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by