How to create an ExportedDefine global variable in Simulink for Code Generation?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Felix
el 2 de En. de 2024
Comentada: Fangjun Jiang
el 3 de En. de 2024
For Code Generation from Matlab code the storage class 'ExportedDefine' allows to make a simulink variable appear in generated C-code as
#define var_name var_value
as described here: https://de.mathworks.com/help/ecoder/ref/coder.storageclass.html.
Is there a way to do this for a (constant) variable when generating code from a Simulink model?
Thanks for your help!
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 2 de En. de 2024
Movida: Fangjun Jiang
el 2 de En. de 2024
Create a Simulink.Parameter, specify the storage class as "Define".
2 comentarios
Fangjun Jiang
el 3 de En. de 2024
Your asked "Is there a way to do this for a (constant) variable when generating code from a Simulink model?"
If just want to have the .h file to do the #define, why not create the .h file directly, manually or create a script to write the text file.
Más respuestas (0)
Ver también
Categorías
Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!