For each set of two columns, you can use sortrows
.
for idx=1:2:size(M,2)
M(:,idx:idx+1)=sortrows(M(:,idx:idx+1),2)
end
2
solved Matlab sort every other column
For each set of two columns, you can use sortrows
.
for idx=1:2:size(M,2)
M(:,idx:idx+1)=sortrows(M(:,idx:idx+1),2)
end
2
solved Matlab sort every other column