Contenuto principale

Specify by function

Deterministic custom code functions

Model Configuration Pane: Simulation Target

Description

The Specify by function parameter specifies which custom code functions are deterministic, that is, always producing the same outputs for the same inputs. This parameter is enabled only when the Deterministic functions parameter is set to By Function. 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.

Settings

none | add | remove

Specify the names of custom code functions that are deterministic, that is, always producing the same outputs for the same inputs.

add

Add a name to the list of custom code deterministic functions.

remove

Remove a name from the list of custom code deterministic functions.

Tip

If you do not see a list of your custom code functions in the Specify by function dialog box, close the dialog box, click Validate custom code, and click Specify by function again.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo recommendation
Safety precautionNo recommendation

Programmatic Use

Parameter: CustomCodeDeterministicFunctions
Type: character vector
Value: names of custom code functions, separated by commas
Default: ""

Version History

Introduced in R2021a