Main Content

addFilterToMatrix

Add matrix settings filter to traceability matrix configuration

Since R2024a

    Description

    example

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

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

    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