Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Suppose I have a multidimensional list as shown below:

RandomInteger[{1,10},{3,7}]

I obtain the results: $$ \left( \begin{array}{ccccccc} 3 & 8 & 3 & 1 & 1 & 2 & 6 \\ 9 & 1 & 9 & 4 & 2 & 3 & 5 \\ 8 & 10 & 9 & 9 & 2 & 1 & 8 \\ \end{array} \right)$$

I applied the function Sort[%]:

$$ \left( \begin{array}{ccccccc} 3 & 8 & 3 & 1 & 1 & 2 & 6 \\ 8 & 10 & 9 & 9 & 2 & 1 & 8 \\ 9 & 1 & 9 & 4 & 2 & 3 & 5 \\ \end{array} \right)$$

But the problem is, I'm trying to sort row-wise. I've played around with other functions but I'm not quite getting what I want. Can someone guide me please?

share|improve this question

closed as off-topic by Artes, Kuba, m_goldberg, ubpdqn, bobthechemist Jul 9 at 14:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Artes, Kuba, m_goldberg, ubpdqn, bobthechemist
If this question can be reworded to fit the rules in the help center, please edit the question.

2  
row-wise means? –  Chenminqi Jul 9 at 12:50
    
Try Sort /@ % instead? –  Verbeia Jul 9 at 12:51
    
Thanks @Verbeia. Thank works great. –  Afloz Jul 9 at 12:55

1 Answer 1

As Verbeia suggests: Try Sort /@ % instead.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.