Simulink test workflow without running the model on each test case

1 visualización (últimos 30 días)
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?

Respuestas (1)

Piyush Dubey
Piyush Dubey el 27 de Jul. de 2023
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.

Categorías

Más información sobre Verification, Validation, and Test en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by