File packaging format
Method of file packaging for generated code files
Model Configuration Pane: Code Generation / Code Placement
Description
Specify whether code generation modularizes the code components into many files or compacts the generated code into a few files. You can specify a different file packaging format for each referenced model.
Settings
Modular (default) | Compact (with separate data file) | CompactDefault: Modular
- Modular
- 
- Outputs - model_data.c- model_private.h- model_types.h- model.c- model.h
- Supports generating separate source files for subsystems. For more information on generating code for subsystems, see Generate Subsystem Code as Separate Function and Files. 
- If you specify Shared code placement as - Autoon the Code Generation > Interface pane of the Configuration Parameter dialog box, some utility files are in the build directory. If you specify Shared code placement as- Shared location, separate files are generated for utility code in a shared location.
 
- Compact (with separate data file)
- Conditionally outputs - model_data.c- model.c- model.h
- If you specify Shared code placement as - Autoon the Code Generation > Interface pane of the Configuration Parameter dialog box, utility algorithms are defined in- model.c
- If you specify Shared code placement as - Auto, and your model contains at least one of these blocks, separate files are generated for utility code in a shared location.- Model blocks 
- Simulink Function blocks 
- Function Caller blocks 
- Calls to Simulink Function blocks from Stateflow® or MATLAB Function blocks 
- Stateflow graphical functions when you select the Export Chart Level Functions parameter 
 
- If you specify Shared code placement as - Shared location, separate files are generated for utility code in a shared location.
- Does not support separate source files for subsystems. 
- Does not support models with noninlined S-functions. 
 
- Compact
- The contents of - model_data.c- model.c
- The contents of - model_private.h- model_types.h- model.h- model.c
- If you specify Shared code placement as - Autoon the Code Generation > Interface pane of the Configuration Parameter dialog box, utility algorithms are defined in- model.c
- If you specify Shared code placement as - Auto, and your model contains at least one of these blocks, separate files are generated for utility code in a shared location.- Model blocks 
- Simulink Function blocks 
- Function Caller blocks 
- Calls to Simulink Function blocks from Stateflow or MATLAB Function blocks 
- Stateflow graphical functions when you select the Export Chart Level Functions parameter 
 
- If you specify Shared code placement as - Shared location, separate files are generated for utility code in a shared location.
- Does not support separate source files for subsystems. 
- Does not support models with noninlined S-functions. 
 
Recommended Settings
| Application | Setting | 
|---|---|
| Debugging | No impact | 
| Traceability | No impact | 
| Efficiency | No impact | 
| Safety precaution | No impact | 
Programmatic Use
| Parameter: ERTFilePackagingFormat | 
| Type: character vector | 
| Value: 'Modular'|'CompactWithDataFile'|'Compact' | 
| Default: 'Modular' | 
Version History
Introduced in R2010a