System Composer Traceability Matrix - How do you display both Requirement ID and its Summary?

In System Composer I have created components and linked them to requirements in the Requirements Editor. When creating a Traceability Matrix, for the requirements axis it is only displaying the requirement summary. I want the requirement axis to display both the Requirement ID and the textual summary.
Even the documentation taken from the link below shows a Traceability Matrix with just the requirement summaries displayed in the diagram:
One of the requirements 'Enable Switch' is acuatally Index 4.1.1 (ID #46).
Any advice which allows me to display both the requirements Index AND the Summary data within the Traceability Matrix?

 採用された回答

Josh Kahn
Josh Kahn 2023 年 12 月 7 日
The traceability matrix displayed attributes are not configurable but it does show the ID attribute so you could use a script to copy all of your index numbers to the ID attribute like this:
function copyRequirementIndexesToID(reqSetName)
% copyRequirementIndexesToID - Copies the index number of the
% requirement into the ID attribute of the requirement.
%
% Usage:
% copyRequirementIndexesToID('MyReqSet.slreqx');
%
arguments
reqSetName (1,:) char {mustBeFile}
end
requirementSet = slreq.load(reqSetName);
requirements = find(requirementSet, Type='Requirement');
if ~isempty(requirements)
for requirement = requirements
requirement.Id = requirement.Index;
end
end
save(requirementSet);
end
Hope this helps,
Josh

2 件のコメント

Daniel Hunt
Daniel Hunt 2023 年 12 月 11 日
That's great Josh. I've just saved this script with the same name as the function and called it with the command window with the slreqz file attribute. It works a treat and the Traceability Matrix now displays the IDs and the requirement Summary. Many thanks.
Josh Kahn
Josh Kahn 2023 年 12 月 12 日
Happy to help! Just be careful to keep them in sync if you are relying on the numbers since they can change if you reorder or add/remove requirements. You can also call the script in the pre-save callback for the requirement set to ensure that it is not stale.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で System Composer についてさらに検索

製品

リリース

R2023b

質問済み:

2023 年 12 月 6 日

コメント済み:

2023 年 12 月 12 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by