Requirements in a Requirements Table
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Pat Canny
il 2 Gen 2025
Modificato: Pat Canny
il 2 Gen 2025
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 Commenti
Pat Canny
il 4 Gen 2025
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
il 6 Gen 2025
Vedere anche
Categorie
Scopri di più su Author Requirements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!