Creating Data Type Alias in the Generated Code, what is "creal32_T "
25 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jake Gareau
am 7 Jul. 2023
Beantwortet: Harsh Saxena
am 10 Jul. 2023
why does generating code with embedded coder produce two typedef for the data type in question?
for example:
#ifndef RTW_HEADER_myHdrFile_h_
#define RTW_HEADER_myHdrFile_h_
#include "rtwtypes.h"
typedef real32_T mySingleAlias;
typedef creal32_T cmySingleAlias;
#endif /* RTW_HEADER_myHdrFile_h_ */
/*
I took this from: Manage replacement of simulink data types in generated code
I dont understand what creal32_T is? its not used in the code and just produces an error when I try to build it in my external project.
0 Kommentare
Akzeptierte Antwort
Harsh Saxena
am 10 Jul. 2023
Hi Jake,
The typedef creal32_T is used to handle the complex values in the generated code. Thus, creal32_T will be a structure with real and imaginary part. If you look into the 'rtwtypes.h' file, you will find the it's declaration like:
typedef struct {
real32_T re;/* Real component*/
real32_T im;/* Imaginary component*/
} creal32_T;
Embedded coder will automatically generate the cmySingleAlias object to deal with the complex 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!