Documentation

Data Definition for Code Generation

To generate efficient standalone code, you must define the following types and classes of data differently than you normally would when running your code in the MATLAB® environment:

DataWhat's DifferentMore Information
ArraysMaximum number of elements is restrictedArray Size Restrictions for Code Generation
Complex numbers
  • Complexity of variables must be set at time of assignment and before first use

  • Expressions containing a complex number or variable evaluate to a complex result, even if the result is zero

    Note:   Because MATLAB does not support complex integer arithmetic, you cannot generate code for functions that use complex integer arithmetic

Code Generation for Complex Data
CharactersRestricted to 8 bits of precisionCode Generation for Characters
Enumerated data
  • Supports integer-based enumerated types only

  • Restricted use in switch statements and for-loops

Enumerated Data
Function handles
  • Same bound variable cannot reference different function handles

  • Cannot pass function handles to or from primary or extrinsic functions

  • Cannot view function handles from the debugger

Function Handles

Was this topic helpful?