Align two arrays by time column

2 visualizaciones (últimos 30 días)
Charles
Charles el 6 de Dic. de 2011
Someone already asked this question, however there is no answer.
"Does anyone know of a MatLab utility to facilitate alignment of two datasets acquired on two devices whose clocks are slightly off? "
Here is exactly what I want to do. I have two arrays:
x1 = 1:5; y1 = 1:5;
x2 = 2:6; y2 = 1:5;
So this is a simplified version of my data. What I want is to visualize this data using a gui, and then align both dataset using a push button. In principle, I know what the push button should do, i.e reduce the value of the array x2 by 1 or increase that of x1 by 1.
However, my knowledge with GUI is limited. I am using 'guide'. I have programmed a counter which should modify the value of the time-axis array and display the increase/decrease required for the alignment. Unfortunately, it doesn't work. Can someone give some help?
Thanks. Charles

Respuestas (1)

Sean de Wolski
Sean de Wolski el 6 de Dic. de 2011
What do you mean 'align'? Is the data identical and so you want the union of them? Do you want a mean over locations of two both? Or dispose of all x2 values where you have an x1, or take the max? Please try and define this so we can tune our answers instead of speculate. For the mean time, a few tools that may be your friends:
doc union %and other set ops
doc accumarray %to do something else with them.
  1 comentario
Charles
Charles el 6 de Dic. de 2011
Ok, both data sets are basically the same if you add 1 to the values of x1. So what I want is to visualize the data and increase or decrease the value of the time axis using push button.

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by