How do I make sure Simulink Constants are coded as #define?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
David
am 20 Mär. 2015
Kommentiert: David
am 24 Mär. 2015
If I have a constant in the Simulink model, this ends up being defined in a structure which then ends up in RAM.
This results in really inefficient software as data needs to be loaded from ROM to RAM at startup and the compiled code has to load the same data from RAM. As the data is constant this also blocks the compiler from producong the most efficient code.
These constants should either be directly coded in the C code or #define
I can't find any settings that make this do what I need.
0 Kommentare
Akzeptierte Antwort
Sebastian Castro
am 20 Mär. 2015
You mean like this? http://www.mathworks.com/help/releases/R2015a/ecoder/ug/macro-definitions-define.html
- Sebastian
0 Kommentare
Weitere Antworten (2)
David
am 23 Mär. 2015
1 Kommentar
Sebastian Castro
am 23 Mär. 2015
First off, glad the answer helped! Secondly -- yes, this page wasn't too straightforward to find.
I went into the MATLAB help and searched for "#define preprocessor". Then, I filtered my results to only look at Embedded Coder. Filtering by product generally helps remove the "noise" from my searches.
- Sebastian
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!