Requirements in a Requirements Table

조회 수: 3 (최근 30일)
Brennan
Brennan 2025년 1월 2일
댓글: Pat Canny 2025년 1월 6일
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.

답변 (1개)

Pat Canny
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
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
Pat Canny 2025년 1월 6일
Thanks for submitting the support request, @Brennan Fox - working with the team now on a response.

댓글을 달려면 로그인하십시오.

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by