I have a 3 column array like this:
A = [6 -1 0; 6 0 3; 1 4 3; 1 2 5];
I need the first column to be in descending order and
If the third column is to be unchanged,
B = A; B(:,1) = sort(B(:,1),'descend'); B(:,2) = sort(B(:,2),'ascend');
If you want the third column to change with the second then,
[B(:,2),ind] = sort(B(:,2),'ascend'); B(:,3) = B(ind,3); B = 6 -1 0 6 0 3 1 2 5 1 4 3