Simulink code generation utility function

7 views (last 30 days)
So, I am generating some C code for a model I have created using some code that I have modified.
The original 'autocoding' scripts produced a .h and .c file called look2_binlxpw
The scipt I have created shoves that look2 inside of the main .h and .c file.
That would normally be okay but the end goal is to provide this code to a customer and when I do so, I would rather have one utility that I can pass forward, since multiple files will end up coding with this look2_bin.
The old code that separated this away from the main function did so using
set_param(subsystem, 'RTWOptions', opts);
Where opts was a huge array of data, but it was set up in there. I am trying to avoid RTWOptions as it is obsolete
rtwtypes, rtgetNaN, rtnonfinite are all created and placed in the project folder. Not sure why this one wont or what the proper parameter for it is.

Accepted Answer

Mark McBroom
Mark McBroom on 6 Mar 2019
If you change the configuration parameter UtilityFunctionGeneration to "Shared location",
set_param(bdroot,'UtilityFuncGeneration', 'Shared location')
then code for blocks such as lookup table blocks will be placed in:
/slprj/ert/_sharedutils

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!