Can I replace custom types during code generation?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Poorna
am 29 Mai 2024
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!