"Sort 3_D array along the third dimension"
显示 更早的评论
https://www.mathworks.com/help/matlab/ref/sort.html has an example of "Create a 2-by-2-by-2 array and sort its elements in ascending order along the third dimension." What does "along the third dimension" mean?
1 个评论
Bruno Luong
2022-7-15
it means for any valid (i, j)
v = squeeze(A(i,j,:))
is sorted.
采纳的回答
更多回答(1 个)
Torsten
2022-7-15
0 个投票
It means that B(:,:,1) <= B(:,:,2) is arranged by ordering the vectors [2,-1], [3,9],[1,0] and [6,12].
类别
在 帮助中心 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!