Sorting multi Dimension matrix

2 ビュー (過去 30 日間)
M@lik Ali
M@lik Ali 2013 年 2 月 5 日
Hi all i have a matrix fset like
fset(:,:,1) =
Columns 1 through 7
0.0417 0.0104 0.1042 0.1771 0.1771 0.1042 0.4271
0.1771 0.2188 0.0313 0.2604 0.0104 0.0625 0.3021
0 0.0833 0.0208 0.0417 0.0313 0.0833 0.0729
0.0313 0.0313 0.0208 0.0313 0.0833 0.0104 0.0521
0.1667 0.0312 0.0625 0.1042 0.3229 0.1146 0.0729
Columns 8 through 14
0.1979 0.0313 0.0833 0.0625 0.0208 0.1042 0.0104
0.3021 0.0521 0.0208 0.0729 0.0104 0.1875 0.0521
0.0833 0.0625 0.1354 0.0104 0.0521 0 0.0417
0.0521 0.1250 0.1042 0.0208 0.0833 0.1771 0.0625
0.1146 0.3125 0.1875 0.0833 0.1667 0.2292 0.0833
Columns 15 through 16
0.0417 0.0104
0.0625 0.1563
0.1354 0.0521
0.0313 0.0729
0.2917 0.0313
fset(:,:,2) =
Columns 1 through 12
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
Columns 13 through 16
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
i want to sort this matrix so that the lowest should be above
how i can do it please help me
  1 件のコメント
Jan
Jan 2013 年 2 月 5 日
Do you mean the "lowest element" and what exactly is "above" in a 3D array?

サインインしてコメントする。

採用された回答

Conrad
Conrad 2013 年 2 月 5 日
Hi, you need to sort along the third dimension:
% Create dummy data.
fset(:,:,1) = rand(5,16); fset(:,:,2) = zeros(5,16);
sorted_fset = sort(fset,3);
Conrad
  1 件のコメント
M@lik Ali
M@lik Ali 2013 年 2 月 5 日
Thanks I will try this.

サインインしてコメントする。

その他の回答 (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