Sorting and averaging Data

1 visualización (últimos 30 días)
Felix
Felix el 31 de Jul. de 2018
Respondida: dpb el 31 de Jul. de 2018
Hey everyone,
I have a the following Problem: I have a table with the structure of the form
GPS_LONG|GPS_LAT|A|B
with lots of data points. What I want to to is to identify the 2D-Data points (GPS_LONG,GPS_LAT) which are equal. If there exists such points, I want to build the mean value over A and B and, so that I only have one unique data point (GPS_LONG,GPS_LAT) left. I know that this could basically done with two loops over the array, comparing each point with all other ones. Since I only have limited computing power and lots of data, I need a smart and efficient way to do it!
Thanks in advance!

Respuesta aceptada

dpb
dpb el 31 de Jul. de 2018
Are the position data points exact duplicates? If so,
[g,tGPS]=findgroups(t.GPS_LONG,t.GPS_LAT); % groups table
tGPS.A=splitapply(@mean,A,g); % add means to the
tGPSB.=splitapply(@mean,B,g); % groups table
If you have positions that are close but not identical that want to consider as equals, build the indication vector of which with ismembertol as a new grouping variable.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices 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