Macros for Functions in generated code.

Hi All, I have a Simulink model that I migrated from 2008a to 2017a, the problem here is when I generate code from that Model the code is different and less efficient, I do think the new implementation takes more memory. Check the following example Version2008a Generate: rt_defines.h #define rt_MIN(ul,u2)( ((u1) <= (u2)) ? (ul) : (u2) ) model.c ParamA= rt_MIN(ParamB+1,ParamC) Version 2017a Generate: rt_defines.h only includes constant parameters(Pi, e, log10) and in the model.c has: if(ParamB+1 <= ParamC) ParamA=ParamB+1 else ParamA=ParamC
Since I am using a lot of these functions (min, max, saturate, etc) I am trying to find the configuration that enables the usage of the "function macros" in the rt_defines.h instead of using the algorithm itself in the code of the model every time that those functions appears. Hope you can understand my problem and help me with it. Thanks

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Asked:

on 16 May 2017

Community Treasure Hunt

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

Start Hunting!