To generate a separate subsystem function and a separate file for a subsystem in a model:
Right-click a Subsystem block. From the context menu, select Block Parameters (Subsystem).
In the Subsystem Parameters dialog box, if the subsystem is virtual, select Treat as atomic unit. On the Code Generation tab, the Function packaging parameter is now available.
Click the Code Generation tab
and select Nonreusable function
from the Function
packaging parameter. The Nonreusable function
option
enables two parameters:
The Function name options parameter controls the naming of the generated function.
The File name options parameter controls the naming of the generated file.
Set the Function name options parameter.
Set the File name options parameter to a value other
than Auto
. If you are generating a reusable function for your
subsystem, see Generate Reentrant Code from Subsystems or Generate Reusable Code from Library Subsystems Shared Across Models.
Click Apply and close the dialog box.
Open the Configuration Parameters dialog box. Set the model configuration parameter
File packaging format to
Modular
.