Sorting a Multidimensional Array

10 ビュー (過去 30 日間)
Luca Lange
Luca Lange 2021 年 4 月 23 日
回答済み: Walter Roberson 2021 年 4 月 23 日
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!

採用された回答

Walter Roberson
Walter Roberson 2021 年 4 月 23 日
[~, idx] = sort(data(1,1,:));
sorted_data = data(:,:,idx);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by