setProperty

Set the property value corresponding to a stereotype applied to the element

Description

setProperty(element,propertyName,propertyValue,propertyUnits) sets the value and units of the property specified in the propertyName argument. Set the property corresponding to an applied stereotype by qualified name <stereotype>.<property> . This is the verbose approach to setting a property.

Examples

collapse all

In this example, weight is a property of the stereotype sysComponent.

applyStereotype(element,'sysProfile.sysComponent')
setProperty(element,'sysComponent.weight','5','g')

In this example, description is a property of the stereotype sysComponent.

expression = sprintf("'%s'",'component description')
setProperty(element,'sysComponent.description',expression)

Input Arguments

collapse all

Data Types: systemcomposer.arch.Element

Qualified name of the property in the form '<stereotype>.<property>'.

Data Types: char

Specify numeric values in single quotes. Specify string values in the sprintf("'%s'",'<property value>') form. See example on this page.

Data Types: char

Specify the units to interpret property values.

Data Types: char

Introduced in R2019a