Generate Subsystem Code as Separate Function and Files

To generate a separate subsystem function and a separate file for a subsystem in a model:

  1. Right-click aSubsystemblock. From the context menu, selectBlock Parameters (Subsystem).

  2. In the Subsystem Parameters dialog box, if the subsystem is virtual, selectTreat as atomic unit. On theCode Generationtab, theFunction packagingparameter is now available.

  3. Click theCode Generationtab and selectNonreusable functionfrom theFunction packagingparameter. TheNonreusable functionoption enables two parameters:

  4. Set theFunction name optionsparameter.

  5. Set theFile name optionsparameter to a value other thanAuto. If you are generating a reusable function for your subsystem, seeGenerate Reentrant Code from SubsystemsorGenerate Reusable Code from Library Subsystems Shared Across Models.

  6. ClickApplyand close the dialog box.