Simulink.SFunctionBuilder.setSettings - Set settings for S-Function Builder block - MATLAB (original) (raw)

Set settings for S-Function Builder block

Since R2022a

Syntax

Description

Simulink.SFunctionBuilder.setSettings([blk](#mw%5F0e7d448b-e247-4288-8c8d-1e4ace0e869b%5Fsep%5Fmw%5Fa03c49e9-1065-4caf-86d4-a666e77c0288),[Name=Value](#namevaluepairarguments)) sets the settings specified using one or more name-value arguments for the S-Function Builder block blk. Use theSimulink.SFunctionBuilder.setSettings function to configure:

To configure the build options for the S-Function Builder block, use theSimulink.SFunctionBuilder.setBuildOptions function.

To specify a name for the S-function, use the Simulink.SFunctionBuilder.setSFunctionName function.

To specify the language for the S-function, use the Simulink.SFunctionBuilder.setTargetLanguage function.

Input Arguments

collapse all

S-Function Builder block, specified as a block handle or as a string or a character vector that defines the block path.

Tips

Name-Value Arguments

collapse all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: ArrayLayout='Column'

Array layout for code, specified as 'Column' or'Row'.

Example: ArrayLayout="Row"

Data Types: char | string

Sample mode for S-function, specified as 'Inherited','Continuous', or 'Discrete'. The sample mode for the block determines when the block computes a new output value.

Example: SampleMode="Continuous"

Data Types: char | string

Discrete sample time for S-function, specified as a scalar, a string, or a character vector. By default, the sample time for an S-Function Builder block is 'Inherited' because the default sample mode is'Inherited'.

Specify the SampleTime name-value argument only when theSampleMode is set to Discrete.

Example: SampleMode="Discrete",SampleTime=0.2

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | char | string

Number of pointers used in S-function, specified as a scalar, a string, or a character vector.

S-functions that use PWorks do not support model operating points.

Example: NumberOfPWorks=3

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | char | string

Option to enable access to SimStruct in wrapper functions, specified as logical0 (false) or 1 (true). When you enable access to the SimStruct, you can use SimStruct macros and functions in the code you write for theOutputs_wrapper, Derivatives_wrapper, andUpdate_wrapper functions.

Example: UseSimStruct=true

Data Types: logical

Whether S-function has direct feedthrough, specified as logical1 (true) or 0 (false).

The direct feedthrough flag for the S-function affects block execution order and is used to detect algebraic loops.

For more information, see S-Function Concepts.

Example: DirectFeedthrough=false

Data Types: logical

Version History

Introduced in R2022a