Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Run set of tests for performance measurement

`results = runperf`

`results = runperf(tests)`

`results = runperf(tests,Name,Value)`

`results = runperf`

runs all the tests in your current folder
for performance measurements and returns an array of
`MeasurementResult`

objects. Each element in
`results`

corresponds to an element in the test suite.

The performance test framework runs the tests using a variable number of
measurements to reach a sample mean with a 0.05 relative margin of error within a
0.95 confidence level. It runs the tests four times to warm up the code, and then
between 4 and 32 times to collect measurements that meet the statistical objectives.
If the sample mean does not meet the 0.05 relative margin of error within a 0.95
confidence level after 32 test runs, the performance test framework stops running
the test and displays a warning. In this case, the `MeasurementResult`

object contains information for the 4 warm-up runs and 32 measurement runs.

The `runperf`

function provides a simple way to run a
collection of tests as a performance experiment.

`results = runperf(`

runs a set of tests with additional options specified by one or more
`tests`

,`Name,Value`

)`Name,Value`

pair arguments.

To customize the statistical objectives of the performance test, use the

`TimeExperiment`

class to construct and run the performance test.

To create a test suite explicitly, you can use the `testsuite`

function or the `matlab.unittest.TestSuite`

methods to
create a suite. Then, you can run your performance test with the `run`

method of your specified `TimeExperiment`

.

`matlab.perftest.FrequentistTimeExperiment`

| `matlab.unittest.measurement.MeasurementResult`

| `runtests`

Was this topic helpful?