hasValue - Find if element instance has property value - MATLAB (original) (raw)
Main Content
Find if element instance has property value
Syntax
Description
[result](#mw%5F23d04d77-e1c5-4e26-b979-fab5b4dbef0b) = hasValue([instance](#mw%5F38e220d0-ec63-4adc-b1a9-81ec1b50c4b2%5Fsep%5Fmw%5Ffd80c2a3-7723-4e5a-911b-df3b748c69dd),[property](#mw%5F38e220d0-ec63-4adc-b1a9-81ec1b50c4b2%5Fsep%5Fmw%5Fab25b719-b6a2-4a8d-807d-27a851db81c4))
queries whether the instance instance
has the given propertyproperty
.
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 query whether an instance element has a property included.
openProject("scExampleSmallUAV"); model = systemcomposer.loadModel("scExampleSmallUAVModel"); instance = instantiate(model.Architecture,"UAVComponent","NewInstance"); queryResult = hasValue(instance.Components(1).Components(1),... "UAVComponent.OnboardElement.Mass")
Input Arguments
Property, specified in the form "<profile>.<stereotype>.<property>"
.
Data Types: char
| string
Output Arguments
Query result, returned as 1
(true
) or 0
(false
).
Data Types: logical
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 | setValue | 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