Main Content

Array layout

Description

Specify the layout of array data for code generation as column-major or row-major.

Category: Code Generation > Interface

Settings

Default: Column-major

Column-major

Generate code in column-major array layout. For example, consider matrix A, which is a 4x3 matrix:

A =
    1    2    3
    4    5    6
    7    8    9
    10   11   12
In column-major array layout, the elements of the columns are contiguous in memory. A is represented in the generated code as:
1    4    7    10    2    5    8    11    3    6    9    12

Row-major

Generate code in row-major array layout. For example, for matrix A, in row-major array layout, the elements of the rows are contiguous. A is represented in the generated code as:

1    2    3    4    5    6    7    8    9    10    11    12

Select parameter Use algorithms optimized for row-major array layout to enable efficient row-major algorithms.

Command-Line Information

Parameter: ArrayLayout
Type: character vector
Value: 'Column-major' | 'Row-major'
Default: 'Column-major'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Related Topics