matlab structure in generated code for variant control
조회 수: 2 (최근 30일)
이전 댓글 표시
is there anyway to control how a matlab structure is generated with embedded coder? for example setting the storage class or name? currently the structure has a random name and only appears if I have parameters set to tunable, it is also nested inside another data structure.
I want to use the structure to control a variant subsystem. Trying to use a simulink.parameter with a bus data type does not work for embedded coder codegen (startup activation).
댓글 수: 0
채택된 답변
Aman
2024년 3월 15일
Hi Jake,
From the information provided, I understand that you want to have control over the name and the storage class in the generated code.
In order to give a custom name to the structure in the generated code, you can use the "coder.cstructname" function, which names the C structure type in the generated code. It can also be used to give a name to the nested structure that is your desired requirement. You can refer to the following documentation link, which discusses the same.
In order to control the storage class in the generated code, you can utilize the "CoderInfo" property of the "Simulink.Parameter" object and the "CustomStorageClass" property of the "CoderInfo" to set the custom storage class. You can refer to the following documentation to learn more about it.
I hope this will help you proceed with your workflow.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!