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

11 次查看(过去 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
"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 中查找有关 Model References 的更多信息

标签

尚未输入任何标签。

产品


版本

R2012b

Community Treasure Hunt

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

Start Hunting!

Translated by