How to generate code of equal simulink blocks only once?

Hi,
In my model I have various LUTs that are equal and after code generation I noticed that Simulink generates code for each LUT block.
So, since the LUTs are equal I would like to know if it is possible to generate code only for one LUT block?
Thank you, André

 Accepted Answer

If you place the LUTs into atomic subsystems, you can take advantage of the Function Packaging options and generate a reusable function.
Take a look at these examples for an idea:
Also, if you want to make sure your multiple instances of the LUT subsystems are all identical so they map to the same reusable function, I'd highly recommend placing them inside a block library.
- Sebastian

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Asked:

on 23 May 2016

Commented:

on 25 May 2016

Community Treasure Hunt

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

Start Hunting!