User`s guide

Traceability for MATLAB Code Lines
8-7
If you want to create traceability links for lines of code in a MATLAB Function block, set
the parent model to store requirements data externally. For a new model, see “Specify
Storage for Requirements Links”. For an existing model, see “Move Internally Stored
Requirements Links to External Storage”. When you create traceability links for code
inside a MATLAB Function block, the RMI stores them in a .req file for the parent
model. The .req file for the model contains requirements traceability data for linked
model objects and for linked code in MATLAB Function blocks in the model.
Limitations of MATLAB Code Traceability
Overlapping Linked Ranges
The software does not support traceability links for overlapping regions of MATLAB
code. If one linked range of code completely overlaps another smaller region of code,
the link for the larger range overshadows the link for the smaller range. To avoid
complications from overlapping linked ranges, when you create traceability links for
MATLAB code lines, choose ranges of code that do not overlap.
Cut and Paste Operations
You can cut or copy a selection of code that has traceability links. When you paste that
selection, the software attempts to recreate the corresponding traceability links at the
paste location. Depending on paste location and code formatting, you might need to
recreate the traceability links manually.
Drag Operation
If you select code that has traceability links and drag that code to a new location, you
might need to recreate traceability links for the code in the new location.
MATLAB Function Block Code Traceability in Web View
Requirements linked to individual MATLAB code lines inside a MATLAB Function block
appear in HTML requirements traceability reports, but do not appear the Simulink
Report Generator Web view. See “Create and Use a Web View” in the Simulink Report
Generator documentation.