Skip to Main Content Skip to Search
Product Documentation

Generate a Traceability Matrix

About Traceability Matrices

When you use Model-Based Design and production code generation to develop application software components, you can generate a traceability matrix. The traceability matrix provides traceability among model objects, generated code, and model requirements. You can add comments to the generated traceability matrix. If you change the model and regenerate the traceability matrix, the software retains your comments.

For a given model, the generated traceability matrix can provide information about:

Generate the traceability matrix using either the iec.ExportTraceReport function from the MATLAB Command Window or the Generate Traceability Matrix button in the generated HTML code generation report for your model. Either method creates an XLS file that contains the following worksheets:

Prerequisites for Generating a Traceability Matrix

Before generating a traceability matrix for model objects, generated code, and model requirements, perform the following steps:

  1. Optionally, attach requirements documents. For more information, see Requirements Traceability in the Simulink Verification and Validation documentation.

  2. In the Configuration Parameters dialog box, on the Code Generation > Report pane, select:

    1. Create code generation report

    2. At least one of the following Traceability Report Contents parameters:

        Tip   If you want to generate the traceability matrix directly from the code generation report, select Open report automatically.

  3. Generate code for the model.

      Tip   You do not have to build an executable to generate a traceability matrix. To generate code only, on the Code Generation > General pane, select Generate code only.

How to Generate a Traceability Matrix

To generate a traceability matrix:

  1. Open the model if it is not already open.

  2. Check that you have completed the Prerequisites for Generating a Traceability Matrix.

  3. Generate the traceability matrix using one of the following methods:

    • In the MATLAB Command Window, enter the following command, where model_name is the name of the model:

      iec.ExportTraceReport('model_name')

      The software generates the traceability matrix.

    • Open the code generation report for the model if it is not already open. Go to the Traceability Report section and click the Generate Traceability Matrix button. For example:

      When you click the button, the Generate Traceability Matrix dialog box appears.

      You can use this dialog box to browse to an existing matrix file to update or specify a new matrix file to create. Optionally, you can also use this dialog box to select and order the columns that appear in the generated matrix. Click OK to update or create the specified report.

  4. Review the traceability matrix and add comments in new columns. For more information, see Add Comments to a Traceability Matrix.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS