MATLAB: Sort and Arrange Matrix for Lookup Table – monotonically increasing

sort matrix array lookup table increasing monotonic monotonically increasing decreasing

Hi, I want to prepare my data for a lookup table. It must be monotonically increasing: How can I do that ?
For example:
Before:
NAN 6 1 8 3 12 10 9
8 Q O R P U T S
1 C A D B G F E
4 J H K I N M L
13 L J M K P O N
9 X V Y W B A Z
12 E C F D I H G
After:
NAN 1 3 6 8 9 10 12
1 A B C D E F G
4 H I J K L M N
8 O P Q R S T U
9 V W X Y Z A B
12 C D E F G H I
13 J K L M N O P

Best Answer

After = sortrows(sortrows(Before).').';