Real-Time Workshop |
 |
General Modeling Techniques
The following are techniques that you can use with any code format:
- The
slupdate
command automatically converts older models to use current features. Run slupdate
on old models.
- Directly inline C code S-functions into the generated code by writing a TLC file for the S-function. See the Target Language Compiler documentation for more information on inlining S-functions. Also see Creating Device Drivers for information on inlining device driver S-functions.
- Use a Simulink data type other than double when possible. The available data types are Boolean, signed and unsigned 8-, 16-, and 32-bit integers, and 32- and 64-bit floats. A double is a 64-bit float. See Using Simulink for more information on data types.
- Remove repeated values in lookup table data.
- Use the Merge block to merge the output of function-call subsystems. This block is particularly helpful when controlling the execution of function-call subsystems with Stateflow.
- This diagram is an example of how to use the Merge block.
| Optimizing the Model for Code Generation | | Expression Folding |  |