Documentation Center

  • Trial Software
  • Product Updates

Documenting Test Results Using MATLAB Report Generator

This example shows how to use MATLAB® Report Generator™ with SystemTest™ to create a custom report documenting results from a test. A sample MATLAB Report Generator file is provided as an example of a custom report.

Report Configuration File

A MATLAB Report Generator file is provided as an example of how to generate a custom report from test results. You can easily extend the report to create additional plots or incorporate additional detail by editing the MATLAB Report Generator file:

setedit('demosystest_resultsreport.rpt');

Click the link below to view a sample HTML report created by SystemTest using this MATLAB Report Generator file. It documents the test results produced by the SystemTest TEST-file by providing an overall summary of the test results and plots for any scalar, vector, or Simulink time series data.

Open the sample HTML report.Open the sample HTML report.

Integration with SystemTest

A MATLAB Report Generator file can be integrated with SystemTest in one of two ways:

  • Run-Time Integration

  • Post Execution Integration

For run-time integration, the report file can be invoked directly by a TEST-file at run-time by using the MATLAB Report Generator report function in the Post Test section. Doing this automatically creates a report as part of the test's execution.

To view an example TEST-file that tests a Simulink® model and generates a custom report, execute the following command:

systemtest('demosystest_resultsreport.test');

The report file can also be invoked after a SystemTest TEST-file has finished running by executing the following command at the MATLAB command line. The report file automatically creates a report by referencing the stresults variable available in the MATLAB workspace. If this variable name does not exist or is not associated with a test results object, the report generation process produces an error.

% Load results from test and generate report.
load demosystest_resultsreport_results
report('demosystest_resultsreport.rpt','-o./report/SampleReport');
stresults =

     Test Results Object Summary for 'S:\sandbox\matlab\toolbox\systemtest\systemtestdemos\demosystest_resultsreport':

            NumberOfIterations: 18
               TestVectorNames: Damping, Mass, Stiffness
              SavedResultNames: pass_fail, position, position_limit, 
                                position_norm, position_sim
                ResultsDataSet: [18x8 dataset]


           Damping     Mass            Stiffness    pass_fail
    I1     [ 5]        [0.1500]        [15]         [0]      
    I2     [ 5]        [0.2000]        [15]         [0]      
    I3     [ 5]        [0.2500]        [15]         [0]      
    I4     [ 7]        [0.1500]        [16]         [0]      
    I5     [ 7]        [0.2000]        [16]         [0]      
    I6     [ 7]        [0.2500]        [16]         [0]      
    I7     [ 9]        [0.1500]        [17]         [1]      
    I8     [ 9]        [0.2000]        [17]         [1]      
    I9     [ 9]        [0.2500]        [17]         [0]      
    I10    [11]        [0.1500]        [18]         [0]      
    I11    [11]        [0.2000]        [18]         [0]      
    I12    [11]        [0.2500]        [18]         [0]      
    I13    [13]        [0.1500]        [19]         [0]      
    I14    [13]        [0.2000]        [19]         [0]      
    I15    [13]        [0.2500]        [19]         [0]      
    I16    [15]        [0.1500]        [20]         [0]      
    I17    [15]        [0.2000]        [20]         [0]      
    I18    [15]        [0.2500]        [20]         [0]      


           position              position_limit    position_norm 
    I1     [750x1 double]        [25]              [159.5778]    
    I2     [750x1 double]        [25]              [129.3550]    
    I3     [750x1 double]        [25]              [111.2890]    
    I4     [750x1 double]        [25]              [ 98.3065]    
    I5     [750x1 double]        [25]              [ 73.9019]    
    I6     [750x1 double]        [25]              [ 54.1731]    
    I7     [750x1 double]        [25]              [ 23.7655]    
    I8     [750x1 double]        [25]              [ 11.0828]    
    I9     [750x1 double]        [25]              [ 26.2874]    
    I10    [750x1 double]        [25]              [ 66.3568]    
    I11    [750x1 double]        [25]              [ 79.0525]    
    I12    [750x1 double]        [25]              [ 93.1292]    
    I13    [750x1 double]        [25]              [134.4940]    
    I14    [750x1 double]        [25]              [145.0764]    
    I15    [750x1 double]        [25]              [156.1930]    
    I16    [750x1 double]        [25]              [198.2295]    
    I17    [750x1 double]        [25]              [206.8613]    
    I18    [750x1 double]        [25]              [215.7951]    


           position_sim      
    I1     [750x1 double]    
    I2     [750x1 double]    
    I3     [750x1 double]    
    I4     [750x1 double]    
    I5     [750x1 double]    
    I6     [750x1 double]    
    I7     [750x1 double]    
    I8     [750x1 double]    
    I9     [750x1 double]    
    I10    [750x1 double]    
    I11    [750x1 double]    
    I12    [750x1 double]    
    I13    [750x1 double]    
    I14    [750x1 double]    
    I15    [750x1 double]    
    I16    [750x1 double]    
    I17    [750x1 double]    
    I18    [750x1 double]    


Was this topic helpful?