Main Content

addFilterToLeft

Add filter to left artifacts in traceability matrix configuration

Since R2024a

    Description

    example

    addFilterToLeft(configuration,filter) adds the filter, filter, to the left artifacts in the traceability matrix configuration, configuration.

    Examples

    collapse all

    This example shows how to add filters to the left and top sides of a traceability matrix view.

    Open the project and get the traceability matrix configuration from the matrix options.

    openProject("CruiseRequirementsExample");
    view = slreq.getTraceabilityMatrixOptions("data\crs_req_tm_view.json");
    configuration = view.options;

    Create a functional requirement filter and add it to the left side of the traceability matrix.

    leftFilter = slreq.matrix.Filter;
    leftFilter.Group ="Type";
    leftFilter.Type ="Functional";
    addFilterToLeft(configuration,leftFilter);

    Create a subs filter and add it to the top of the traceability matrix.

    topFilter = slreq.matrix.Filter;
    topFilter.Group ="Type";
    topFilter.Type ="Subsystem";
    addFilterToTop(configuration,topFilter);

    Generate the updated traceability matrix.

    slreq.generateTraceabilityMatrix(view);

    Clear and close the Requirements Editor.

    slreq.clear

    Input Arguments

    collapse all

    Traceability matrix configuration to add filter to, specified as an slreq.matrix.Configuration object.

    Traceability matrix filter to add to configuration, specified as an slreq.matrix.Filter object.

    Version History

    Introduced in R2024a