# distanceProfile

Compute distance profile between query subsequence and all other subsequences of a time series

*Since R2024b*

## Syntax

## Description

### Return Distance Profile

returns the `DP`

= distanceProfile(`X`

,`len`

,`loc`

)*distance profile* (vector of z-normalized Euclidean
distances) between a query subsequence of the time series `X`

and every
subsequence in `X`

that has the same length `len`

.
The query begins at the time series position `loc`

.The query
subsequence is therefore defined by `X(loc:loc+len-1)`

.

`[___] = distanceProfile(___,Name=Value)`

specifies options using one or more name-value arguments in addition to the arguments in
previous syntaxes. For example, to exclude matches near the query starting position, set
`ExcludeTrivialMatches`

to `true`

.

### Plot Distance Profile

`distanceProfile(___)`

plots an interactive plot of the
distance profile, with overlays for the query, the motif (best match to query), and the
discord (worst match to query). You can move the vertical selection lines in the plot to
find the top motif and discord of any other data segments n the time series.

You can use this syntax with any of the previous input-argument combinations.

## Examples

## Input Arguments

## Output Arguments

## References

[1] Yeh, Chin-Chia Michael, et al.
“Matrix Profile I: All Pairs Similarity Joins for Time Series: A Unifying View That Includes
Motifs, Discords and Shapelets.” *2016 IEEE 16th International Conference on Data
Mining (ICDM)*, IEEE, 2016, pp. 1317–22. DOI.org (Crossref), https://doi.org/10.1109/ICDM.2016.0179.

## Version History

**Introduced in R2024b**