Deterministic functions
Custom code functions that produce same outputs for same inputs
Model Configuration Pane: Simulation Target
Description
The Deterministic functions parameters specifies which custom code functions are deterministic, that is, always producing the same outputs for the same inputs. If a custom code function is specified as deterministic, then a C Caller or C Function block that calls that function can be used in a For Each subsystem or with continuous sample time, and the block is optimized for use in conditional input branch execution. When a block is optimized for use in conditional input branch execution, it is executed only if it is in the active branch of a Switch or Multiport Switch block, both in simulation and in generated code. See Conditional input branch execution. This parameter is enabled only if Import custom code is selected.
Settings
All | By functionNoneNone of the custom code functions are deterministic.
AllAll of the custom code functions are deterministic.
By functionThe custom code functions that are deterministic are listed in Specify by function.
Note
If a C Function block references any custom code global variables in its code, then this parameter must be set to All in order for the block to be used in a For Each subsystem or with continuous sample time, or to be optimized for use in conditional input branch execution.
Recommended Settings
| Application | Setting |
|---|---|
| Debugging | No impact |
| Traceability | No impact |
| Efficiency | No recommendation |
| Safety precaution | No recommendation |
Programmatic Use
Parameter: DefaultCustomCodeDeterministicFunctions |
| Type: character vector |
Value: "None" | "All" | "ByFunction" |
Default: "None" |
Version History
Introduced in R2021a