Hi,
I have two 3d matrices (A and B) with the same size (m,n,o).
I want to sort matrix B along the third dimension based on the sort index of matrix A:
[~, idx] = sort(A,3,'descend')
If I use the following syntax it doesn't really work:
B = B(:,:,idx)
I get a (m,n,m*n*o) matrix instead of a sorted (m,n,o) matrix.
Any ideas?
Best Answer