- Using Initialize Function which executes contents on a model initialize event, instead of the model callback InitFcn
- By specifying *Configuration Parameters > Code Generation > Custom code *to include in the generated model initialize function.
How can I have Model InitFcn Callback generated in model Init function using Embedded Coder?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 26 Mag 2020
Risposto: MathWorks Support Team
il 26 Mag 2020
I have a model which is doing:
output = input + par_init + par_edit
- par_edit: shall be tunable, to set this value externaly before running the generated code.
- par_init, is calculated from the first parameter par_edit, and defined in Simulink in the Model-Callback InitFcn.
The generated code looks like
/* Model step function */
void ModelInit_step(void)
{
ModelInit_Y.Out1 = (ModelInit_U.In1 + 6.123233995736766E-17) + par_edit;
}
/* Model initialize function */
void ModelInit_initialize(void)
{
}
How can I have Model InitFcn Callback generated in model Init function?
Risposta accettata
MathWorks Support Team
il 26 Mag 2020
Model initialize function code could be generated in the following methods:
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Deployment, Integration, and Supported Hardware in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!