On Wednesday, 13 June 2012 12:47:13 UTC-3, Lance wrote:
> I have a matrix MATRIX with values that I want to rearrange. I also
>
> have another matrix INDEX that is the same shape of MATRIX that has
>
> the order of the columns for the rearrangement.
...
> Is there any succinct way of creating this new matrix using MATRIX and
>
> INDEX?
>
> Lance
Dyalog APL, and 'AssertEq' does a check for equality....
MATRIX←4 3⍴⍳12
INDEX←4 3⍴3 2 1 2 1 3 1 2 3 2 3 1
RESULT←4 3 ⍴ 3 2 1 5 4 6 7 8 9 11 12 10
AssertEq RESULT on 4 3⍴MATRIX[↑(⍳4),¨¨↓INDEX]
I hope I matched your data correctly.