How can I make Embedded Coder use "memset" instead of enormous hard-coded constants?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 11 Juin 2019
Modifié(e) : MathWorks Support Team
le 19 Avr 2023
How can I make Embedded Coder use "memset" instead of enormous hard-coded constants?
I have a constant block containing an array with 100e3 elements. I have enabled "Use memset to initialize floats and doubles to 0.0", but this constant shows up as 100e3 hard-coded zeros in the "*.c" generated code file. This constant takes up more than 6000 lines of code--all zeros.
Run below command in MATLAB 2016b for documentation:
>> web(fullfile(docroot, 'simulink/gui/use-memset-to-initialize-floats-and-doubles-to-0-0.html'))
Or for latest release documentation on using memset to initialize floats and doubles to 0.0, please refer to:
Réponse acceptée
MathWorks Support Team
le 19 Avr 2023
Modifié(e) : MathWorks Support Team
le 19 Avr 2023
Make sure that the "Inline invariant signals" optimization has been enabled.
Run below command in MATLAB 2016b for documentation:
>> web(fullfile(docroot, 'simulink/gui/inline-invariant-signals.html'))
Or for latest release documentation on inline invariant signals, please refer to:
This setting can interact with using "memset" such that "memset" is not used unless "Inline invariant signals" has been enabled.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!