This example shows how to work with requirements in an architecture model.
Allocate functional requirements to components to establish traceability. By creating a link between a component and the related requirement, you can track whether all requirements are represented in the architecture. You can also keep requirements and design in sync, for example, if a requirement changes or if the design warrants a revision of the requirements. You can link components to requirements in Simulink® Requirements™, test cases in Simulink Test™, or selections in MATLAB®, Microsoft® Excel®, or Microsoft Word.
Open the model exMobileRobot
.
open_system('exMobileRobot')
Open the requirements MobileRobotRequirements.slreqx
in the Requirements Editor. The requirements file must be on the MATLAB path. Select the requirement to be linked.
Select the component to be linked in the architecture model. Right-click and select Requirements > Link to Selection in Requirements Editor.
When you first link a requirement in an architecture model, a link set file with extension .slmx
is created to store requirement links. The Requirements context menu displays the linked requirements.
You can also create a link using the Requirements Editor. First, select the component in the architecture model. Then, in the Requirements Editor, right-click the requirement and select Link from <component_name> (Component).
You can also create requirement links with blocks and subsystems in Simulink models. for more information, see Link Blocks and Requirements (Simulink Requirements).
The badge on a component indicates that it is linked to a requirement. This badge also shows at the lower-left corner of the architecture model.
To trace requirement links to a component, right-click and select Requirements > Open Outgoing Links dialog. Here, you can create new requirements, delete existing ones, and change their order.