Requirements in a Requirements Table
11 ビュー (過去 30 日間)
古いコメントを表示
If I load a requirements table via the slreq.load function, how can the requirement information assocaited with that ReqSet be accessed via commands and NOT through the requirements manager or requirements editor simulink GUIs? I have seen information regarding adding requirements, but there is nothing detailing how to view existing requirements.
0 件のコメント
回答 (1 件)
Pat Canny
2025 年 1 月 2 日
編集済み: Pat Canny
2025 年 1 月 2 日
Once you load a Requirement Set, you can use methods from slreq.ReqSet or slreq.Requirement to query or modify the requirement set.
Here's a quick example that retrieves and displays the Id and Descriptions for requirements with type "Requirement" in a Requirement Set loaded from a model containing a Requirements Table:
% Open a Requirements Table example
openExample('shared_vnv/SpecModelForRequirementsTestingExample')
% Load link set and requirement set from model
mdlName = "spec_model_final.slx";
[aLinkSet,aReqSet] = slreq.load(mdlName);
% Find all Requirements in requirements set
reqs = find(aReqSet,"Type","Requirement");
% Create table with Requirement ID and Description
numReqs = length(reqs);
reqDescriptions = cell(numReqs,1);
reqIDs = cell(numReqs,1);
for k = 1:numReqs
reqIDs{k} = reqs(k).Id;
reqDescriptions{k} = reqs(k).getDescriptionAsText;
end
reqIdsAndDescriptions = table(reqIDs,reqDescriptions,'VariableNames',["ID","Description"])
Thanks.
- Pat
Requirements Toolbox Product Manager
5 件のコメント
Pat Canny
2025 年 1 月 4 日
Thanks for clarifying.
We have something we can share with you. We unfortunately can't communicate it via MATLAB Answers as it isn't officially documented. Could you please contact MathWorks Technical Support (category "Help using products") and ask the support team to "escalate" this to the Requirements Toolbox Development Team? You can add a link to this thread in the support request.
Pat Canny
2025 年 1 月 6 日
参考
カテゴリ
Help Center および File Exchange で Model and Validate Requirements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!