coder.rowMajor
Specify row-major array layout for a function or class
Syntax
Description
coder.rowMajor specifies row-major array layout for the data
used by the current function in generated code. When placed in a class constructor,
coder.rowMajor specifies row-major layout for data used by
the class.
Note
By default, code generation uses column-major array layout.
Examples
Tips
To specify row-major array layout for all the functions in your generated code, use the
codegen -rowmajoroption.Other functions called from within a row-major function inherit the row-major specification. However, if one of the called functions has its own distinct
coder.columnMajorcall, the code generator changes the array layout accordingly. If a row-major function and a column-major function call the same function, which does not have its own array layout specification, the code generator produces a row-major version and column-major version of the function.coder.rowMajoris ignored outside of code generation and simulation.
Extended Capabilities
Version History
Introduced in R2018a
See Also
coder.ceval | coder.columnMajor | coder.isColumnMajor | coder.isRowMajor
Topics
- Generate Code That Uses Row-Major Array Layout (MATLAB Coder)
- Specify Array Layout in Functions and Classes (MATLAB Coder)
- Generate Code That Uses N-Dimensional Indexing (MATLAB Coder)
- Interface with Row-Major Data in MATLAB Function Blocks
- Code Generation of Matrices and Arrays (Simulink Coder)