Simulink test workflow without running the model on each test case
1 次查看(过去 30 天)
显示 更早的评论
I am using MATLAB R2021b Update 6, and in particular i am creating a test suit in Simulink Test for a simulink model. I also have a requirement set in simulink requirements, that has links to the model.
In the test suite, each test case is linked to a requirement, since i need to have traceability between tests and requirements.
The problem is that each test case needs to run a simulation of the model to have data for the test, but since each run takes much time, running all of the test cases is really time consuming.
My question is then: is it possible to run the test case without having to run the model each time, but running the simulation one time, and taking the data from the workspace, and run a test on those data?
0 个评论
回答(1 个)
Piyush Dubey
2023-7-27
Hi Stefano,
Simulations can be run by specifying the parameters using the ‘sim’ or ‘run’ command. The documentation for the same is attached below:
The ‘From Workspace’ block in Simulink allows reading the data from workspace to the model, this workspace can be base, model or mask workspace.
Alternatively, data can be preserved outside the workspace as an external file which can be loaded once at the time of test suite setup and will be reutilized from there. Other ways of capturing simulation data can be found in the following documentation:
The process of opening the model and running the simulation can also be optimized by using load_system() instead of open_sytem() which will be just loading the model and not actually opening the canvas. After using load_system() to multiple models close_system() can be used to unload data from the memory.
Hope this helps.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Verification, Validation, and Test 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!