How to create an ExportedDefine global variable in Simulink for Code Generation?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
채택된 답변
Fangjun Jiang
2024년 1월 2일
이동: Fangjun Jiang
2024년 1월 2일
Create a Simulink.Parameter, specify the storage class as "Define".
댓글 수: 2
Fangjun Jiang
2024년 1월 3일
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.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!