Main Content

链接和跟踪需求

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.

A Simulink Requirements license is required to link, trace, and manage requirements in System Composer™.

Open the modelexMobileRobot.

systemcomposer.openModel('exMobileRobot');

Manage requirements and architecture together in theRequirements Managerfrom Simulink Requirements. Navigate toApps>Requirements Manager. You are now in the Requirements perspective in System Composer.

Links can be created and managed through the Requirements perspective. For more information, seeManage Requirements. This example shows an alternative approach using the Requirements Editor.

Open the requirements in the要求编辑器.

slreq.open('MobileRobotRequirements');

Select the requirement to be linked.

Select the component to be linked in the architecture model. Right-click and selectRequirements > Link to Selection in Requirements Browser.

When you first link a requirement in an architecture model, a link set file with extension.slmxis created to store requirement links. TheRequirementscontext 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 selectLink from "" (Component).

You can also create requirement links with blocks and subsystems in Simulink models. for more information, seeLink Blocks and Requirements(Simulink Requirements).

Thebadge 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 the命令component and selectRequirements > Open Outgoing Links dialog. Here, you can create new requirements, delete existing ones, and change their order.

See Also

Related Topics