MATLAB: How to customize the function prototype of the “step” routine (modelname_step()) in the code generated using Simulink Coder 8.0 (R2012b)

simulink

I am executing rtwbuild() on a few different models,
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.

Best Answer

"model_step()" and is the default name of the step routine in the code generated from a Simulink model.
To customize this function prototype's appearance in the generated code, the code interface must be configured appropriately.This can be done from the “Model Interface” window. To open this window:
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. Now configure the names of the “step” function and the arguments of the “step” function to include all relevant input/output structures.
Related Question