Simplify software distribution and reduce the time and resources required to develop software by designing models from which you can generate reusable code. Use key Simulink® componentization techniques to partition a model into design components that you simulate, generate code for, and verify independently. The code generator produces reusable function code from referenced models, subsystems, and library subsystems.
Why you reuse code and associate code reuse and reentrancy.
Comparison of techniques for generating reusable code.
Generate reusable code from Simulink Function blocks.
Create reusable library subsystems to generate code for subsystems that models share.
Determine why the code generator does not reuse subsystem code as you expect.
Generate reusable subsystem code from a top model with Model blocks.
Share generated code for constant parameters across models.
Generate reusable code for linked and unlinked atomic subcharts.
Reusable, Reentrant Code
Why generate reentrant code.
Generate reusable, reentrant code from top models.
Generate reusable, reentrant code from subsystems.
Generate reusable, reentrant code from Simulink Function blocks that are scoped to a model.
Restrictions, constraints, and considerations that apply to code definitions and code mappings.
Shared Utility Code
Modularize and share common Model block functionality as helper functions.
Generate reusable code for fixed-point support functions.
Generate reusable code for custom data types.