| SystemTest™ | ![]() |
| On this page… |
|---|
Managing Test Results Data in its Native Format |
After accessing test results data in the form of a dataset array, you can work with the data in MATLAB®. This feature is useful for comparing the test results data of separate test runs and for postprocessing of test results data.
One advantage to accessing test results data at the command line is that all of the MATLAB plotting tools are available to use on the test results data. You can plot the data using any of the plot types MATLAB offers.
Another major use of the datatset array is to quickly see the results when you use a Limit Check element in your test. You can see whether each iteration passed or failed, and what the value was.
You can use indexing to extract out data of the dataset in its native format. You can index by string or value.
For example, you can assign a variable to represent the dataset, then access one column of the set using that variable. In the case of the Fault Tolerant Fuel Control System demo this example has been using, it could look like the following.
Create a variable to refer to the test results dataset array:
SetA = stresults.ResultsDataSet;
In this example the test results data is assigned to the variable SetA.
Specify the desired columns of data by referencing the name of the test result.
SetA.AvgFuelRate
This indexed into the column called AvgFuelRate.
Note When extracting data in its native format, the test results are always returned as a cell array. |
MATLAB displays the contents of that column of data, as shown in this example:

The first 10 iterations are shown in the example.
You can also choose to manage the test results as a dataset array, refining the data as finely as needed. Suppose you just want to get the average fuel rate for iterations 4 through 8. Use standard MATLAB indexing, as shown in the next example:

The value returned represents the average fuel rate for iterations 4 through 8, in the form of a dataset array.
To demonstrate plotting results, you can use another demo called Simple Demo.
Open the demo in the SystemTest™ software by typing the following at the MATLAB command line:
systemtest simple_demo
Run the test by clicking the Run button on the SystemTest toolbar.
View the results summary using stresults at the command line.

You can see that this test has one test vector for a signal, called signal, and three saved results. The result for Y is the signal's value for a given test run.
Look at the test results dataset by typing the following:
stresults.ResultsDataSet
The first 10 iterations are shown here:

You can see the test vector signal followed by the three results, including the one of interest in this example, Y.
Create a variable called SetB for the results dataset for ease of use in working with the data.
SetB = stresults.ResultsDataSet;
Create variables for the signal (the test vector) and the Y test result.
signalA = SetB.signal; VarA = SetB.Y;
Plot the signal. Because Y represents the current value of the signal for each iteration of the test, plotting the signal against Y shows the values of the signal throughout the test.
plot([signalA{:}], [VarA{:}])The plot command produces a line plot, as shown here. You can use any type of plot that MATLAB offers.

To use another plot type, such as a scatter plot, replace the plot command.
scatter([signalA{:}], [VarA{:}])

![]() | Viewing Test Results at the Command Line | Accessing Test Results While a Test is Running | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |