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)
| Compact
Default: Modular
Modular
-
Outputs
,model
_data.c
, andmodel
_private.h
, in addition to generatingmodel
_types.h
andmodel
.c
. For the contents of these files, see the table in Generated Code Modules.model
.hSupports 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
Auto
on 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 asShared location
, separate files are generated for utility code in a shared location.
Compact (with separate data file)
Conditionally outputs
, in addition to generatingmodel
_data.c
andmodel
.c
.model
.hIf you specify Shared code placement as
Auto
on the Code Generation > Interface pane of the Configuration Parameter dialog box, utility algorithms are defined in
.model
.cIf 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
are inmodel
_data.c
.model
.cThe contents of
andmodel
_private.h
are inmodel
_types.h
ormodel
.h
.model
.cIf you specify Shared code placement as
Auto
on the Code Generation > Interface pane of the Configuration Parameter dialog box, utility algorithms are defined in
.model
.cIf 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