Main Content

hasValue

Find if element instance has property value

    Description

    example

    result = hasValue(instance,property) queries whether the instance instance has the given property property.

    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

    collapse all

    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")
    queryResult = logical
       1
    
    

    Input Arguments

    collapse all

    Property, specified in the form "<profile>.<stereotype>.<property>".

    Data Types: char | string

    Output Arguments

    collapse all

    Query result, returned as a logical.

    Data Types: logical

    More About

    collapse all

    Definitions

    TermDefinitionApplicationMore 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 size, weight, and power (SWaP) analysis to increase efficiency.

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

    TermDefinitionApplicationMore Information
    stereotype

    Stereotypes provide a mechanism to extend the core language elements and add domain-specific metadata.

    Apply stereotypes to core element types. An element can have multiple stereotypes. Stereotypes allow you to style different elements. Stereotypes provide elements with a common set of properties, such as mass, cost, and power.

    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.

    You can use profiles to create a domain of specialized 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