getValue

Get value of property from element instance

Description

example

[value,unit] = getValue(instance,property) obtains the property of the instance and assigns it to value. This function is part of the instance API that you can use to analyze the model iteratively, element by element.instance refers to the element instance on which the iteration is being performed.

Examples

collapse all

Assume that a MechComponent stereotype is attached to the specification of the instance.

weightValue = getValue(instance,'MechComponent.weight');

Input Arguments

collapse all

Element instance, specified by a systemcomposer.analysis.ArchitectureInstance, systemcomposer.analysis.ComponentInstance, systemcomposer.analysis.PortInstance, or systemcomposer.analysis.ConnectorInstance object. This function is part of the instance API that you can use to analyze the model iteratively, element by element.instance refers to the element instance on which the iteration is being performed.

Property, specified as a character vector in the form '<stereotype>.<property>'.

Data Types: char

Output Arguments

collapse all

Property value, returned as a data type that depends on how the property is defined in the profile.

Property unit, returned as a character vector that describes the unit of the property as defined in the profile.

Introduced in R2019a