Main Content

Array Layout

Column-major and row-major order for array storage

Array layout refers to the order in which array elements are stored in memory. By default, Simulink® uses column-major layout. In a MATLAB Function block, you can use row-major. Row-major layout can improve performance for certain algorithms and ease integration with external code or data that uses row-major. Linear indexing operations always use column-major layout.

Functions

coder.cevalCall C/C++ function from generated code
coder.columnMajorSpecify column-major array layout for a function or class
coder.rowMajorSpecify row-major array layout for a function or class
coder.isColumnMajorDetermine whether the current function or variable uses column-major layout
coder.isRowMajorDetermine whether the current function or variable uses row-major layout

Topics