This question is basically an extension of that question.
I have a matrix A in Matlab and want to sort that matrix along one dimension:
A = rand(3,3,5);
[B idx] = sort(A,3);
Now idx is a matrix containing the "sorted" indices. How can i get back the matrix A using only B and idx?
The answer of the original question doesn't work for matrices, unfortunately.
w(ix,:)=v, where:represents "ignored" dimensions? - Crowleyw(idx)=Bworks but it is incorrect - shamalaia