setProperty

Set property value corresponding to stereotype applied to element

Description

example

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

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 | double | enum

Units of property to interpret property values, specified as a character vector.

Data Types: char

Introduced in R2019a