Main Content
Use dynamic memory allocation for model initialization
Whether to allocate dynamic memory for initializing model data
Model Configuration Pane: Code Generation / Interface
Description
The Use dynamic memory allocation for model initialization parameter specifies whether the code generator allocates dynamic memory for initializing model data.
Dependency
To enable this parameter, set the Code interface packaging parameter to Reusable function
.
Settings
Off
(default) | On
- On
Enables generation of a function that allocates memory (using
malloc
) for model data structures dynamically.- Off
Disables generation of a dynamic memory allocation function. The generated code allocates memory for model data structures statically.
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No recommendation |
Programmatic Use
Parameter: GenerateAllocFcn |
Type: character vector |
Value: 'on' | 'off' |
Default: 'off' |
Version History
Introduced in R2013b