What is the command to fetch Requriement detail from the simulink model?
4 views (last 30 days)
Show older comments
What is the command to fetch Requriement detail from the simulink model?
0 Comments
Answers (1)
Namnendra
on 18 Apr 2024
Hi Vickey,
To fetch requirement details from a Simulink model, you typically use functions provided by Simulink Requirements™. The specific command or function you use can depend on what exact information you need (e.g., links, descriptions, etc.). However, a common approach to access requirement details linked to Simulink objects is through the `slreq.getLinks` function. Here's a basic example of how you might use it:
% Get links associated with a specific block
blockPath = 'model_name/block_path';
links = slreq.getLinks(blockPath);
% Display information about each link
for i = 1:length(links)
disp(['Link ID: ', links(i).ID]);
disp(['Description: ', links(i).Description]);
disp(['Keywords: ', links(i).Keywords]);
% Access other properties as needed
end
This example assumes you have a Simulink model with requirements linked to it, possibly through Simulink Requirements. The `slreq.getLinks` function retrieves links associated with the specified block or model path. You can then iterate through these links to access and display their details.
More information can be found here:- Get links from link set - MATLAB - MathWorks India
For more advanced usage, including fetching requirements from a requirements document or querying specific properties of the requirements, refer to the Simulink Requirements documentation and look for functions like `slreq.find`, which can be used to find and filter requirements based on various criteria.
Remember, the availability of these functions and their exact behavior can depend on your MATLAB and Simulink Requirements version, so it's a good idea to consult the documentation specific to your version.
Hope the above information helps.
Thank you.
See Also
Categories
Find more on Simulink Environment Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!