Why do I not see any definitions for my Simulink.Parameter object in the generated code when using 'CompilerFlag' storage class?

I have a parameter defined in the Simulink Model Explorer. I've set the storage class of the parameter to 'CompilerFlag' in the hope that I'll see a definition for the parameter in one of the header files in the generated code. However, all I see is the following:
 
#ifndef myParam
#error The variable for the parameter "myParam" is not defined
#endif
Where is the parameter defined?

 Réponse acceptée

When using the 'CompilerFlag' storage class, Embedded Coder expects the user to provide the definition for the parameter through a compiler flag. For information on how to do this, please refer to the following documentation:
Please run the below command in the MATLAB R2018b command window to get the release specific documentation
web(fullfile(docroot, 'ecoder/ref/addcompileflags.html'))
If you wish to see the parameter defined in the generated code, please consider using the 'Define' storage class. This will create a separate header file and place the parameter definition within that file. For more information on this storage class, please refer to the following link:
Please run the below command in the MATLAB R2018b command window to get the release specific documentation
web(fullfile(docroot, 'ecoder/ug/macro-definitions-define.html'))
Please follow the below link to search for the required information regarding the current release:

Plus de réponses (0)

Catégories

En savoir plus sur Test Model Components dans Centre d'aide et File Exchange

Produits

Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by