- Run the Simulink Test Suite: First, the test suite is run using the "Simulink Test Manager", ensuring that tests are configured to log the necessary signals for inclusion in the report.
- Export Test Results Programmatically: After the tests have been run, the test results can be exported using the "Simulink Test” API. The "sltest.testmanager.run” function, can be used to run tests and obtain a result set object.
- Access Logged Data: For each test case result, the logged data needs to be accessed. This data could be logged in the "Simulation Data Inspector", requiring the use of the Data Inspector API to extract this data.
- Create a Report Using MATLAB Report Generator: The "MATLAB Report Generator" is used to programmatically create a report, adding sections for each test case indicating whether it passed or failed, and including plots of the relevant waveforms.
- MATLAB Report Generator: www.mathworks.com/help/releases/R2021b/rptgen/index.html
- Simulink Test: www.mathworks.com/help/releases/R2021b/sltest/getting-started-with-simulink-test.html
- Simulation Data Inspector: www.mathworks.com/help/releases/R2021b/simulink/slref/simulationdatainspector.html