User`s guide
Associate Traceability Information with MATLAB Code Lines in Simulink
8-15
Create Traceability Link for Lines of Code Inside MATLAB Function Blocks
The slvnvdemo_synaptic_transmission model has a MATLAB Function block that we
will want to trace to parameter value sources. Instead of linking the block itself, open the
MATLAB code of this block and link specific lines. For example, in the Simulink Editor,
click on the Synaptic strength constant block to select it for linking. In the MATLAB
Editor, find the occurrence of I_amplitude on line 33 of the MATLAB Function block
code. Right-click the line and from the Requirements Traceability context menu,
select Link to Selection in Simulink.
Create Traceability Link Between Lines in MATLAB Code and Microsoft Word
Until this point we only looked at linking between MATLAB and Simulink. Open the
Ion current calculation MATLAB Function block that belongs to the Sodium current
calculation subsystem of the referenced slvnvdemo_neuron model. Right-click on a
highlighted line or lines and from the Requirements Traceability context menu,
navigate a link at the top. The associated Word document opens to the associated text.
To create a similar link in another MATLAB Function block of this model, Ion current
calculation Function in Potassium channel current subsystem, select the relevant content
in the Word document (i.e. outward current of potassium ions). Then, open the
Potassium channel current MATLAB Function block. In the MATLAB Editor, select the
implementation for outwardCurrent subfunction (lines 34-37). Right-click the selected
lines and in the context menu, select Requirements Traceability > Link to Selection
in Word. Minimize the Word document, then navigate from the newly highlighted lines
at the bottom of the MATLAB code to the related description in Word. When the correct
location is highlighted, use the MATLAB icon to navigate back to code.