Main Content

Simulink.SFunctionBuilder.update

Update attributes for input port, output port, or parameter of S-Function Builder block

    Description

    Simulink.SFunctionBuilder.update(blk,elem,Name=elemName,FieldToUpdate=field,NewValue=newVal) updates the value of the specified property for an input port, output port, or parameter of the S-Function Builder block blk.

    To add a new input port, output port, or parameter to an S-Function Builder block, use the Simulink.SFunctionBuilder.add 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

    • To get the block handle for a block in your model, use the getSimulinkBlockHandle function.

    • To get the block handle for the most recently selected or added block, use the gcbh function.

    Type of element to update, specified as one of these options:

    • 'Input' — Update property for input port on S-Function Builder block.

    • 'Output' — Update property for output port on S-Function Builder block.

    • 'Parameter' — Update property for parameter of S-Function Builder block.

    Data Types: char | string

    Name of input port, output port, or parameter to update, specified as a string or a character vector.

    Data Types: char | string

    Property of input port, output port, or parameter to update, specified as one of these options:

    • 'Name' — Update input port, output port, or parameter name.

    • 'DataType' — Update input port, output port, or parameter data type.

    • 'Complexity' — Update input port, output port, or parameter complexity.

    • 'Dimensions' — Update input port or output port dimensions.

      Do not specify FieldToUpdate='Dimensions' when you specify the second input argument as 'Parameter'.

    • 'Value' — Update parameter value.

      Do not specify FieldToUpdate='Value' when you specify the second input argument as 'Input' or 'Output'.

    Data Types: char | string

    New value for property of input port, output port, or parameter, specified as a string or a character vector that contains the new value. The values you can specify depend on the property you want to update.

    Property to UpdateValid Values

    Name

    Valid port name

    Data type

    'double'

    'single'

    'boolean'

    'int8'

    'int16'

    'int32'

    'uint8'

    'uint16'

    'uint32'

    'Fixdt:binary(a,b,c)'

    'Fixdt:slope and bias(a,b,c,d)'

    'Bus: <object name>'

    Complexity

    'real'

    'complex'

    Port dimensions

    scalar or vector

    Parameter value

    Valid value for specified parameter

    Data Types: char | string

    Version History

    Introduced in R2022a