Sorting a Multidimensional Array
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Luca Lange
le 23 Avr 2021
Réponse apportée : Walter Roberson
le 23 Avr 2021
Dear All,
I have measurement results in the form of a 65x48x504 array. I want to sort these 504 'layers' of data by a certain value, namely the data(1, 1, :) values.
It seems like sortrows() is limited to 2D cases, and I could not figure out how to use a for loop to adress the array correctly for this operation.
Any help is greatly appreciated!
0 commentaires
Réponse acceptée
Walter Roberson
le 23 Avr 2021
[~, idx] = sort(data(1,1,:));
sorted_data = data(:,:,idx);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!