Can I replace custom types during code generation?
3 次查看(过去 30 天)
显示 更早的评论
I have a Simulink model that I use to develop my algorithm.
I am part of a larger project, other teams do not use Matlab nor Simulink.
I am using a manually defined bus that is based on a "typedef struct {} foo;" provided in a header that I can access.
To minimize complexity at the interface, I would like to use this type rather than having a separate type being defined in "<my model>_types.h".
I tried data type replacement, but that seems to work only for basic types.
Is there any way to achieve what I need?
0 个评论
采纳的回答
Poorna
2024-5-29
Hi Federico,
It sounds like you're working with external code that utilizes custom struct definitions from a header file, and you're looking to streamline integration by generating code that directly uses these structs. A practical approach to achieve this in Simulink is by leveraging buses. You can modify your model so that the variables intended to match the external structs are represented using buses. These buses can be set up to ensure that the generated code aligns with your requirements.
Please refer to the following documentation. It has the step by step information on generating code that matches the external data types:
Hope this Helps!
0 个评论
更多回答(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!