1

I want to sort the array

a = {{{1, 0, 0}, {1, 1, 1}, {0.5, 0.0, 0.5}}, {{-1}, {1}, {-1}}}

in the following way: a[[1]] and a[[2]] have one-to-one correspondence; Sort a[[2]] from small to great value, at the same time, the sequence of a[[1]] will be rearranged accordingly.

In the end, I want to get a new array as

{{{1, 0, 0}, {0.5, 0.0, 0.5}, {1, 1, 1}}, {{-1}, {-1}, {1}}} 

Is there some simple way to realized this in Mathematica?
I appreciate your help!

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
S. Mu
  • 11
  • 3

0 Answers0