coder.columnMajor
Specify column-major array layout for a function or class
Syntax
Description
coder.columnMajor
specifies column-major array layout for the
data used by the current function in generated code. When placed in a class
constructor, coder.columnMajor
specifies column-major layout
for data used by the class.
Note
By default, code generation uses column-major array layout.
Examples
Tips
The code generator uses column-major array layout by default.
The specification of array layout inside a function supersedes the array layout specified with the
codegen
command. For example, if the functionfoo
containscoder.columnMajor
, and you generate code by using:codegen foo -rowmajor
then the generated code still uses column-major layout.
Other functions called from within a column-major function inherit the column-major specification. However, if one of the called functions has its own distinct
coder.rowMajor
call, 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.columnMajor
is ignored outside of code generation and simulation.
Extended Capabilities
Version History
Introduced in R2018a