Simulink.SFunctionBuilder.update
Update attributes for input port, output port, or parameter of S-Function Builder block
Since R2022a
Description
Simulink.SFunctionBuilder.update(
updates the value of the specified property for an input port, output port, or parameter of
the S-Function Builder block blk
,elem
,Name=elemName
,FieldToUpdate=field
,NewValue=newVal
)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
blk
— S-Function Builder block
block handle | string | character vector
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.
elem
— Type of element to update
'Input'
| 'Output'
| 'Parameter'
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
elemName
— Name of input port, output port, or parameter to update
string | character vector
Name of input port, output port, or parameter to update, specified as a string or a character vector.
Data Types: char
| string
field
— Property of input port, output port, or parameter to update
'Name'
| 'DataType'
| 'Complexity'
| 'Dimensions'
| 'Value'
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'
.'Unit'
— Update unit value for input port, output port, or parameter.
Data Types: char
| string
newVal
— New value for property of input port, output port, or parameter
string | character vector
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 Update | Valid Values |
---|---|
Name | Valid port name |
Data type |
|
Complexity |
|
Port dimensions | scalar or vector |
Parameter value | Valid value for specified parameter |
Unit | Unit for input port, output port, or parameter |
Data Types: char
| string
Version History
Introduced in R2022a
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)