Main Content

AnyComponent

Create query to select all components in model

    Description

    query = AnyComponent creates a query query that the find and createView functions use to select all components in the model.

    example

    Examples

    collapse all

    Import the namespace that contains all of the System Composer™ queries.

    import systemcomposer.query.*

    Open the Simulink® project file for the keyless entry system.

    openProject("scKeylessEntrySystem");

    Load the architecture model.

    model = systemcomposer.loadModel("KeylessEntryArchitecture");

    Create a query to find all components and list the second component.

    constraint = AnyComponent;
    components = find(model,constraint,Recurse=true,IncludeReferenceModels=true);
    comp = components(2)
    comp = 1×1 cell array
        {'KeylessEntryArchitecture/Sound System'}
    
    

    Output Arguments

    collapse all

    Query, returned as a systemcomposer.query.Constraint object.

    More About

    collapse all

    Version History

    Introduced in R2019b