Main Content

addFilterToTop

Add filter to top artifacts in traceability matrix configuration

Since R2024a

    Description

    addFilterToTop(configuration,filter) adds the filter, filter, to the top artifacts in the traceability matrix configuration, configuration.

    example

    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(fullfile("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);

    Add the matrix artifacts and generate the updated traceability matrix.

    configuration.LeftArtifacts = fullfile("documents","crs_req_func_spec.slreqx");
    configuration.TopArtifacts = fullfile("models","crs_controller.slx");
    slreq.generateTraceabilityMatrix(view);

    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