필터 지우기
필터 지우기

How to obtain a header file with customized name on code generation from an enum defined in a script(.m) file in matlab?

조회 수: 6 (최근 30일)
Hello, I am working on model based application development using Matlab Simulink. I have defined an enum in a script(.m file) in matlab. I am using the elements of the enum in a model as enumerated constants. Now, when I generate C code out of the model, I want the enum to be generated as a seperate header file(.h) with a particular name say abcd.h Does anybody know how to implement this? Thanks in advance.

채택된 답변

TAB
TAB 2013년 2월 22일
편집: TAB 2013년 2월 22일
You can generated the enum definitions in the separate header file using HeaderFile and DataScope properties during the definition of enums in m file.
Simulink.defineIntEnumType(ClassName, CellOfEnums, IntValues, 'HeaderFile',... FileName, 'DataScope', 'Exported');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by