injectAnomaly
Inject anomalies defined by one or more anomaly models into a univariate time series
Since R2026a
Syntax
Description
Add-On Required: This feature requires the Time Series Anomaly Detection for MATLAB add-on.
[
inserts the anomaly or set of anomalies defined by outTS,outLabels] = injectAnomaly(synthAnom,inTS)synthAnom. The
software injects each anomaly in a separate 10-sample window that starts at a random
location within the time series.
Use injectAnomaly, in conjunction with the anomaly models you
create with syntheticAnomaly, to provide various types of anomalous data that you can use
to validate anomaly detection models.
[
sets additional options using name-value arguments. For example, use the following command
to set the start of the window to 300 samples and length of the window to
15.outTS,labelsOut] = injectAnomaly(___,Name=Value)
[outTS] = injectAnomaly(synthAnom,inTS,WindowStart=300,WindowLength=15)
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Version History
Introduced in R2026a

