i kind want to pull the blue curve forward in time to match the red curve , so that the peaks match in time. that is the marker curve should be moved 20 seconds forward.

1 visualizzazione (ultimi 30 giorni)

Risposte (1)

Star Strider
Star Strider il 12 Ago 2020
Just add (or subtract) 20 seconds from the blue curve time value, then plot them together.
A simple example:
xr = 1:20;
yr = sin(2*pi*xr/10);
xb = 1:25;
yb = cos(2*pi*xb/10);
figure
subplot(2,1,1) % Original
plot(xr, yr, 'r')
hold on
plot(xb, yb, 'b')
grid
subplot(2,1,2) % Shifted
plot(xr, yr, 'r')
hold on
plot(xb+2.5, yb, 'b')
grid
The finddelay function can also be helpful here.
.

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by