User`s guide

Create a Custom Requirements Link Type
9-11
Create a Custom Requirements Link Type
In this example, you implement a custom link type to a hypothetical document type,
a text file with the extension .abc. Within this document, the requirement items are
identified with a special text string, Requirement::, followed by a single space and then
the requirement item inside quotation marks (").
You will create a document index listing all the requirement items. When navigating
from the Simulink model to the requirements document, the document opens in the
MATLAB Editor at the line of the requirement that you want.
To create a custom link requirement type:
1
Write a function that implements the custom link type and save it on the MATLAB
path.
For this example, the file is rmicustabcinterface.m, containing the function,
rmicustabcinterface, that implements the ABC files shipping with your
installation.
2
To view this function, at the MATLAB prompt, type:
edit rmicustabcinterface
The file rmicustabcinterface.m opens in the MATLAB Editor. The content of the
file is:
function linkType = rmicustabcinterface
%RMICUSTABCINTERFACE - Example custom requirement link type
%
% This file implements a requirements link type that maps
% to "ABC" files.
% You can use this link type to map a line or item within an ABC
% file to a Simulink or Stateflow object.
%
% You must register a custom requirement link type before using it.
% Once registered, the link type will be reloaded in subsequent
% sessions until you unregister it. The following commands
% perform registration and registration removal.
%
% Register command: >> rmi register rmicustabcinterface
% Unregister command: >> rmi unregister rmicustabcinterface
%
% There is an example document of this link type contained in the
% requirement demo directory to determine the path to the document
% invoke:
%
% >> which demo_req_1.abc
% Copyright 1984-2010 The MathWorks, Inc.