Azzera filtri
Azzera filtri

What is the command to fetch Requriement detail from the simulink model?

3 visualizzazioni (ultimi 30 giorni)
What is the command to fetch Requriement detail from the simulink model?

Risposte (1)

Namnendra
Namnendra il 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.
  1 Commento
Vickey Vardwaj
Vickey Vardwaj il 22 Apr 2024
Thank you so much for helping me here,
I tried to run those commands that you have shared but getting the below error, i am missing some toolbox?
>> blockPath = 'PrkngLghtSrvCL/PrkngLghtSrvCL_Main_sys';
links = slreq.getLinks(blockPath)
Unable to resolve the name 'slreq.getLinks'.
and below are the tool box i have in my machine
MATLAB Version 23.2 (R2023b)
Simulink Version 23.2 (R2023b)
AUTOSAR Blockset Version 23.2 (R2023b)
BTC EmbeddedPlatform Version 23.3 (R23.3p0)
Embedded Coder Version 23.2 (R2023b)
Fixed-Point Designer Version 23.2 (R2023b)
MATLAB Coder Version 23.2 (R2023b)
MATLAB Compiler Version 23.2 (R2023b)
MATLAB Compiler SDK Version 23.2 (R2023b)
MATLAB Report Generator Version 23.2 (R2023b)
MES Model & Refactor® (MoRe) Version 4.16.0
MES Model Examiner (MXAM) - Functional Safety S... Version 10.0.0 (7010cea422350098aa96d7cc6c76e0b64ac4e544)
Requirements Toolbox Version 23.2 (R2023b)
Simulink Check Version 23.2 (R2023b)
Simulink Coder Version 23.2 (R2023b)
Simulink Coverage Version 23.2 (R2023b)
Simulink Report Generator Version 23.2 (R2023b)
Simulink Test Version 23.2 (R2023b)
Stateflow Version 23.2 (R2023b)

Accedi per commentare.

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by