MATLAB Answers

0

How can I make Embedded Coder use "memset" instead of enormous hard-coded constants?

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.

Tags

No tags entered yet.

Products


Release

R2016b

1 Answer

Answer by MathWorks Support Team on 19 Jun 2019 at 4:00
 Accepted Answer

Make sure that the "Inline invariant signals" optimization has been enabled.
This setting can interact with using "memset" such that "memset" is not used unless "Inline invariant signals" has been enabled.

  0 Comments

Sign in to comment.