dtw

DTW (dynamic time warping)

Contents

Syntax

Description

dtw(vec1, vec2) returns the DTW distance between two vectors vec1 and vec2.

dtw(vec1, vec2, dtwOpt) perform DTW by using the given parameters in dtwOpt, with the fields

dtw(vec1, vec2, dtwOpt, showPlot) plots the DTW path

[minDist, dtwPath, dtwTable] = dtw(...) returns additions information:

Depending on the value of dtwOpt.type, this function calls dtw1, dtw2, or dtw3.

Example

vec1=[71 73 75 80 80 80 78 76 75 73 71 71 71 73 75 76 76 68 76 76 75 73 71 70 70 69 68 68 72 74 78 79 80 80 78];
vec2=[69 69 73 75 79 80 79 78 76 73 72 71 70 70 69 69 69 71 73 75 76 76 76 76 76 75 73 71 70 70 71 73 75 80 80 80 78];
[minDist, dtwPath, dtwTable]=dtw(vec1, vec2);
dtwPathPlot(vec1, vec2, dtwPath);

See Also

dtwPathPlot, dtwBridgePlot, dtw1, dtw2, dtw3.


Top page   Next: dsScatterPlot3.m   Prev:dtw1.m