Difficulty in understanding Dynamic time warping plots
Show older comments
I have two signals, which I am trying to compare. Data 1 ranges from 0 to 15 seconds. Data 2 ranges from 0 to 12 seconds.

I have used dtw function and result can be seen in figure. From that figure I don't understand what is the x axis here. I suppose it is time in milli seconds, but then how did my data that ran for 0 to 15 and 12 seconds end up at 950 ms. Also in the figure, the original signal shows a much shorter x axis.
Answers (1)
Image Analyst
on 28 Apr 2023
The x axis is in elements or indexes. If you want it in millseconds you have to create an x vector and use it in plot
x1 = linspace(0, 15, numel(Data1));
x2 = linspace(0, 12, numel(Data2));
plot(x1, Data1, 'b-', 'LineWidth', 2);
hold on;
grid on;
plot(x2, Data2, 'r-', 'LineWidth', 2);
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!