getValue
Description
[
obtains the property value
,unit
] = getValue(instance
,property
)property
of the instance
instance
and assigns it to the specified value
value
.
Note
This function is part of the instance programmatic interfaces that you can use to analyze
the model iteratively, element-by-element. The instance
refers to the
element instance on which the iteration is being performed.
Examples
Get Mass Property Value
Load the small unmanned aerial vehicle (UAV) model, create an architecture instance, and get the mass property value of a nested component.
scExampleSmallUAV model = systemcomposer.loadModel("scExampleSmallUAVModel"); instance = instantiate(model.Architecture,"UAVComponent","NewInstance"); [massValue,unit] = getValue(instance.Components(1).Components(1),... "UAVComponent.OnboardElement.Mass")
massValue = 1.7000
unit = 'kg'
Input Arguments
instance
— Element instance
architecture instance | component instance | port instance | connector instance
Element instance, specified as a systemcomposer.analysis.ArchitectureInstance
, systemcomposer.analysis.ComponentInstance
, systemcomposer.analysis.PortInstance
, or systemcomposer.analysis.ConnectorInstance
object.
property
— Property
character vector | string
Property, specified in the form "<profile>.<stereotype>.<property>"
.
Data Types: char
| string
Output Arguments
value
— Property value
double
(default) | single
|
int64
| int32
| int16
|
int8
| uint64
| uint32
|
uint8
| boolean
| string
|
enumeration class name
Property value, returned as a data type that depends on how the property is defined in the profile.
unit
— Property unit
character vector
Property unit, returned as a character vector that describes the unit of the property as defined in the profile.
Example: 'kg'
Data Types: char
More About
Definitions
Term | Definition | Application | More Information |
---|---|---|---|
analysis | Analysis is a method for quantitatively evaluating an architecture for certain characteristics. Static analysis analyzes the structure of the system. Static analysis uses an analysis function and parametric values of properties captured in the system model. | Use analyses to calculate overall reliability, mass roll-up, performance, or thermal characteristics of a system, or to perform a SWaP analysis. | |
analysis function | An analysis function is a MATLAB® function that computes values necessary to evaluate the architecture using the properties of each element in the model instance. | Use an analysis function to calculate the result of an analysis. | |
instance model | An instance model is a collection of instances. | You can update an instance model with changes to a model, but
the instance model will not update with changes in active variants or model references. You can
use an instance model, saved in a | Run Analysis Function |
instance | An instance is an occurrence of an architecture model element at a given point in time. | An instance freezes the active variant or model reference of the component in the instance model. | Create a Model Instance for Analysis |
Term | Definition | Application | More Information |
---|---|---|---|
stereotype | A stereotype is a custom extension of the modeling language. Stereotypes provide a mechanism to extend the architecture language elements by adding domain-specific metadata. | Apply stereotypes to model elements such as root-level architecture, component architecture, connectors, ports, data interfaces, value types, functions, requirements, and links. Functions only apply to software architectures. You must have a Requirements Toolbox™ license to apply stereotypes to requirements and links. A model element can have multiple stereotypes. Stereotypes provide model elements with a common set of property fields, such as mass, cost, and power. | Extend Architectural Design Using Stereotypes |
property | A property is a field in a stereotype. You can specify property values for each element to which the stereotype is applied. | Use properties to store quantitative characteristics, such as weight or speed, that are associated with a model element. Properties can also be descriptive or represent a status. You can view and edit the properties of each element in the architecture model using the Property Inspector. | |
profile | A profile is a package of stereotypes that you can use to create a self-consistent domain of element types. | Author profiles and apply profiles to a model using the Profile Editor. You can store stereotypes for a project in one or several profiles. When you save profiles, they are stored in XML files. |
Version History
Introduced in R2019a
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)