Main Content

Compile-time recursion limit for MATLAB functions


For compile-time recursion, control the number of copies of a function that are allowed in the generated code. This parameter applies to MATLAB® code in a MATLAB Function block, a Stateflow® chart, or a System object associated with a MATLAB System block. This parameter applies to the model during simulation and code generation.

Category: Simulation Target > Advanced parameters


Default: 50

  • To disallow recursion in the MATLAB code, set this parameter to 0.

  • The default compile-time recursion limit is high enough for most recursive functions that require compile-time recursion. If code generation fails because of the recursion limit, and you want compile-time recursion, increase the limit. Alternatively, you can change your MATLAB code so that the code generator uses run-time recursion.

Command-Line Information

Parameter: CompileTimeRecursionLimit
Type: integer
Value: valid value
Default: 50

Related Topics