TimeExperiment that collects variable
number of measurements
FrequentistTimeExperiment is a subclass of the
class that collects a variable number of measurements. The testing framework collects a
variable number of measurements to reach a specified relative margin of error within a
specified confidence level.
To create a
matlab.perftest.TimeExperiment.limitingSamplingError static method.
NumWarmups — Number of warm-up measurements
5 (default) | nonnegative integer
Number of warm-up measurements, specified as a nonnegative integer.
NumWarmups defines the number of times that the
framework runs the test code to warm it up.
MinSamples — Minimum number of samples
4 (default) | integer greater than 1
Minimum number of sample measurements, specified as an integer greater than 1.
MinSamples defines the minimum number of times that
the framework runs the test code after
framework exercises the test code at least
times, regardless of whether the experiment meets the statistical
MaxSamples — Maximum number of samples
256 (default) | integer greater than or equal to
Maximum number of sample measurements, specified as an integer greater than or equal to
the maximum number of times that the framework runs the test code after
NumWarmups. The framework will stop after it takes
MaxSamples samples, even if the experiment does not
meet the statistical objectives.
RelativeMarginOfError — Goal relative margin of error for samples
0.05 (default) | positive number
Goal relative margin of error for samples, specified as a positive number.
The framework calculates the Relative Margin of Error for a
X using the equation
the T-score from Student's T distribution using the specified
ConfidenceLevel — Confidence level for samples to be within relative margin of error
0.95 (default) | number between 0 and 1
Confidence level for the samples to be within the relative margin of error, specified as a number between 0 and 1.
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Version HistoryIntroduced in R2016a
R2023a: Default number of warm-up measurements has increased
The default number of times that the framework exercises the test code to warm it up in a frequentist time experiment has increased from four to five. This change results in typically fewer samples required to meet the objective relative margin of error.
If you want to use the previous default value, explicitly specify the value in your code. This table shows an example of how to update code that runs tests using four warm-up measurements.
import matlab.perftest.TimeExperiment experiment = TimeExperiment.limitingSamplingError; results = run(experiment,mySuite);
import matlab.perftest.TimeExperiment experiment = TimeExperiment.limitingSamplingError("NumWarmups",4); results = run(experiment,mySuite);