Valid: 1
Samples: [4×7 table]
TestActivity: [8×12 table]
Totals:
1 Valid, 0 Invalid.
As indicated by the size of the TestActivity property, the performance testing
framework collected 14 measurements. This number includes 4 measurements to warm
up the code. The Samples property excludes warm-up measurements.
Display the sample measurements for the first test.
results(1).Samples
ans =
4×7 table
Name MeasuredTime Timestamp Host Platform Version RunIdentifier
______________________________ ____________ ____________________ _______ ________ ________________________________ ____________________________________
fprintfTest/testPrintingToFile 0.090988 26-Oct-2018 14:09:10 MY-HOSTNAME win64 9.6.0.979037 (R2019a) Prerelease 84305243-69b9-4104-a50e-459ce687ceb9
fprintfTest/testPrintingToFile 0.092055 26-Oct-2018 14:09:10 MY-HOSTNAME win64 9.6.0.979037 (R2019a) Prerelease 84305243-69b9-4104-a50e-459ce687ceb9
fprintfTest/testPrintingToFile 0.0918 26-Oct-2018 14:09:10 MY-HOSTNAME win64 9.6.0.979037 (R2019a) Prerelease 84305243-69b9-4104-a50e-459ce687ceb9
fprintfTest/testPrintingToFile 0.085175 26-Oct-2018 14:09:11 MY-HOSTNAME win64 9.6.0.979037 (R2019a) Prerelease 84305243-69b9-4104-a50e-459ce
Compute Statistics for Single Test Element
Display the mean measured time for the first test. To exclude data collected in the warm-
up runs, use the values in the Samples field.
sampleTimes = results(1).Samples.MeasuredTime;
meanTest = mean(sampleTimes)
meanTest =
0.0900
Compute Statistics for All Test Elements
Determine the average time for all the test elements. The fprintfTest test includes two
different methods. Compare the time for each method (test element).
Since the performance testing framework returns a Samples table for each test element,
concatenate all these tables into one table. Then group the rows by test element Name,
and compute the mean MeasuredTime for each group.
33 Unit Testing