User`s guide

Where to Find Information in This Manual
2-5
LibMdlRegCustomCode, LibSystemInitializeCustomCode,
LibSystemOutputCustomCode
, LibSystemUpdateCustomCode,
LibSystemDerivativeCustomCode
, LibSystemEnableCustomCode,
LibSystemDisableCustomCode
, LibSystemUserCodeIsEmpty
Alternatively, you can look at hookslib.tlc and cachelib.tlc for brief
descriptions of these functions. The TLC files are located in
matlabroot/rtw/c/tlc.
3. Optimizing Generated Code
The default settings are generic for flexible rapid prototyping systems. The
penalty for this flexibility is code that is less than optimal. There are several
optimization techniques that you can use to minimize the source code size and
memory usage once you have a model that meets your requirements.
For the embedded-C target, see “Embedded-C Code Format” on page 12-14.
This section contains information about optimization specifically for the
Embedded-C code format.
See “Optimizations Common to All Code Formats” on page 12-21 for a complete
discussion of code optimization techniques available for all the code formats.
4. Validating Generated Code
Using the generic real-time (grt) environment provided by The MathWorks,
you can create an executable that runs on your workstation and creates a
model.mat file. You can then compare the results of the generic real-time
simulation with the results of running a Simulink simulation.
For more information on how to validate Real-Time Workshop generated code,
see “Blocks That Depend on Absolute Time” on page 2-21.
5. Incorporating Generated Code into Legacy Code
If your Real-Time Workshop generated code is intended to be a piece of an
existing code base (for example, if you want to use the generated code as a
plug-in function), you should use the embedded-C code format. See
“Embedded-C Code Format” on page 12-14 for a discussion of this form of code
generation.