setValue - Set value of property for element instance - MATLAB (original) (raw)
Set value of property for element instance
Syntax
Description
setValue([instance](#mw%5Fc9489a38-4539-4944-a093-4178a79e0a97%5Fsep%5Fmw%5Ffd80c2a3-7723-4e5a-911b-df3b748c69dd),[property](#mw%5Fc9489a38-4539-4944-a093-4178a79e0a97%5Fsep%5Fmw%5Fab25b719-b6a2-4a8d-807d-27a851db81c4),[value](#mw%5F02018b8c-0faf-4d01-8535-4611e81939c5))
sets the property property
of the instanceinstance
to the value specified byvalue
.
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
Load the small unmanned aerial vehicle (UAV) model, create an architecture instance, and set the mass property value of a nested component. Get the new value to confirm the change.
openProject("scExampleSmallUAV"); model = systemcomposer.loadModel("scExampleSmallUAVModel"); instance = instantiate(model.Architecture,"UAVComponent","NewInstance"); setValue(instance.Components(1).Components(1),... "UAVComponent.OnboardElement.Mass",2); [massValue,unit] = getValue(instance.Components(1).Components(1),... "UAVComponent.OnboardElement.Mass")
Input Arguments
Property, specified in the form "<profile>.<stereotype>.<property>"
.
Data Types: char
| string
Property value, specified as a data type that depends on how the property is defined in the profile.
More About
Term | Definition | Application | More Information |
---|---|---|---|
Analysis | Static analysis analyzes the structure of the system to quantitatively evaluate an architecture for certain characteristics. Static analysis uses an analysis function and parametric values of properties and parameters 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 size, weight, and power (SWaP) analysis to increase efficiency. | Analyze Architecture Model Properties with Analysis FunctionAnalyze ArchitectureSimple Roll-Up Analysis Using Robot System with Properties |
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 and instance-specific parameters at the component and architecture levels. | Use an analysis function to calculate the result of an analysis. | Analysis Function ConstructsWrite Analysis Function |
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 MAT file, of a System Composerâ„¢ architecture model for analysis. | 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 |
Version History
Introduced in R2019a
See Also
Tools
Functions
- instantiate | iterate | lookup | save | update | refresh | systemcomposer.analysis.loadInstance | systemcomposer.analysis.deleteInstance | getValue | hasValue | getParameter | getEvaluatedParameterValue | getParameterNames | getParameterValue | setParameterValue | isArchitecture | isComponent | isConnector | isPort | getQualifiedName
Objects
- systemcomposer.analysis.Instance | systemcomposer.analysis.ArchitectureInstance | systemcomposer.analysis.ComponentInstance | systemcomposer.analysis.PortInstance | systemcomposer.analysis.ConnectorInstance