Main Content

addFilterToMatrix

Add matrix settings filter to traceability matrix configuration

Since R2024a

    Description

    addFilterToMatrix(configuration,filter) adds the matrix settings filter, filter, to the traceability matrix configuration, configuration.

    example

    Examples

    collapse all

    This example shows how to add matrix setting and cell filters to a traceability matrix configuration, then generate the updated matrix.

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

    openProject("ShortestPathChangesExample");
    view = slreq.getTraceabilityMatrixOptions(fullfile("src","shortestPath_tm.json"));
    configuration = view.options;

    Create a cell filter and add the filter to the configuration.

    cellFilter = slreq.matrix.Filter;
    cellFilter.Group = "Type";
    cellFilter.Type = "Implement";
    addFilterToCell(configuration,cellFilter);

    Create a matrix settings filter and add the filter to the configuration.

    matrixFilter = slreq.matrix.Filter;
    matrixFilter.Group = "Matrix";
    matrixFilter.Type =  "HasChangedLink";
    addFilterToMatrix(configuration,matrixFilter);

    Add the matrix artifacts and generate the updated traceability matrix.

    configuration.LeftArtifacts = fullfile("requirements","shortest_path_func_reqs.slreqx");
    configuration.TopArtifacts = fullfile("src","shortest_path.m");
    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