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.ceval | Call C/C++ function from generated code |
coder.columnMajor | Specify column-major array layout for a function or class |
coder.rowMajor | Specify row-major array layout for a function or class |
coder.isColumnMajor | Determine whether the current function or variable uses column-major layout |
coder.isRowMajor | Determine whether the current function or variable uses row-major layout |
Topics
- Interface with Row-Major Data in MATLAB Function Blocks
Use row-major layout for C/C++ code generation and external C code integration.
- Specify Array Layout in Functions and Classes
Combine different array layouts in a single code project.
- Code Design for Row-Major Array Layout
Design your code for efficient use of array layout.