Sort multidimensional array along one dimension

3 visualizaciones (últimos 30 días)
Lennart
Lennart el 2 de Dic. de 2013
Comentada: Lennart el 2 de Dic. de 2013
I have a [80 80 3 646 2] sized array of measurements which represent [80 80 3] points each with its 646 values at [: : : : 1] and time of measurement at [: : : : 2]. Now I want to order this 5 dimensional array along the values of time of measurement (so I can more easily interpolate/downsample later, but the first step I cant figure out is ordering).
I tried the sort function on the last dimension, but that did not sort it along the time values.

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 2 de Dic. de 2013
If you want to sort along the fifth dimension, use:
xsorted = sort(x,5);
  3 comentarios
Sean de Wolski
Sean de Wolski el 2 de Dic. de 2013
It sounds to me like you really have two separate arrays: a 4d array for measurement and a 4d array for time. If you create these, you can sort them how you wish (use the second output from sort to do the ordering in both if necessary).
Lennart
Lennart el 2 de Dic. de 2013
Ah terrific, this works

Iniciar sesión para comentar.

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