Loop unrolling threshold
Specify minimum array size width for generating for
loops
Model Configuration Pane: Code Generation / Optimization
Description
The Loop unrolling threshold specifies the minimum array size
width for which a for
loop is generated.
Dependencies
If you want to use this parameter for specifying the minimum array size width for
parallel for
-loops, Embedded Coder® is required.
Settings
5
(default)Specify the array size at which the code generator begins to use a
for
loop instead of separate assignment statements to assign
values.
When there are perfectly nested loops, the code generator uses a for loop if the product of the loop counts for loops in the perfect loop nest is greater than or equal to the threshold.
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | >0 |
Safety precaution | No impact |
Programmatic Use
Parameter:
RollThreshold |
Type: character vector |
Value: valid value |
Default:
'5' |
Limitations
Loop unrolling optimization is not supported in Simulink models that contain both For Each Subsystem blocks and Model References, regardless of their configuration or hierarchy.
Version History
Introduced before R2006a