What are the real_T and int_T datatypes referenced in the Simulink template CMEX S-function?
46 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I was looking at sfuntmpl.c and saw that these data types are used exclusively in this file and in your examples. I would like to know if I have to define my variables in this matter, or if I can use double, int, and the other C types.
Akzeptierte Antwort
MathWorks Support Team
am 27 Jun. 2009
You do not have to use int_T or real_T anywhere in your CMEX file. We recommend that you use these type definitions, which are defined in the header file tmwtypes.h. This allows greater platform independence in your MEX-file. Using real_T allows you to switch between different data types for 16,32,64 bit systems, allowing more flexibility.
However, you do not have to use these definitions at all in your model. For example, you can edit the Simulink example S-function csfunc.c located in $MATLABROOT/simulink/src. On a PC, you can change all of the real_T to double and all of the int_T to int, compile the S-function, and it will behave the same way.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!