Main Content

Maximum line width

Maximum line width for wrapping generated code

Model Configuration Pane: Code Generation / Code Style

Description

Specify the maximum line width for wrapping generated code.

Settings

80 (default) | value from 50-1000

Default: 80

Specify an integer value that indicates the maximum number of columns in a single line of generated code. Possible values range from 50–1000 columns.

If the comments exceed the maximum line width specified, the tail comments are generated on a new line with right justification. Other types of comments are not wrapped:

  • #define tail comments

  • Simulink block comments

  • Stateflow object comments

  • Banner comments

Examples

expand all

Compare how the generated code wraps when you set Maximum line width to 80 and 120.

Here is generated code that is wrapped using the default Maximum line width value 80:

/* Definition for custom storage class: Default */
real_T const_val[4] = { 1.0, 2.0, 3.0, 4.0 } ;
                  /* This parameter defines the vector of output index values */
The tail comments are generated on a new line with right justification.

Here is the same code wrapped with Maximum line width set to 120:

/* Definition for custom storage class: Default */
real_T const_val[4] = { 1.0, 2.0, 3.0, 4.0 } ;/* This parameter defines the vector of output index values */

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: MaxLineWidth
Type: integer
Value: integer from 50–1000
Default: 80

Version History

Introduced in R2019a