How to create a blank SLMX file?
14 views (last 30 days)
Show older comments
MathWorks Support Team
on 24 Feb 2023
Answered: MathWorks Support Team
on 27 Feb 2023
I would like to create a blank SLMX file and then program it from scratch. How can I accomplish this workflow?
Accepted Answer
MathWorks Support Team
on 24 Feb 2023
As of R2022b, a direct method to manually create SLMX files is not available.
When you create a requirements link ("slreq.Link" object) from a Simulink object (source artifact) to a requirement, Requirements Toolbox™ automatically creates a link set ("slreq.LinkSet" object) and saves it as an SLMX file in the same folder as the source artifact.
One indirect way to create a blank link set is to create a mock link and delete it later. A blank link set file can be created for a loaded Simulink model using following script:
% Create a mock requirement set with single Requirement
rs = slreq.new('mockName')
r1 = add(rs)
% Create a temporary link to mock requirement
l1 = slreq.createLink(gcb, r1)
ls = l1.linkSet
% Delete the temporary link
l1.remove()
% Discard the mock requirements
r1.remove()
rs.discard()
% Save the link set file
ls.save()
For more information on "slreq.Link" and "slreq.LinkSet" objects, please refer to the following documentation:
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!