In matlab, how can I sort a matrices columns in ascending order by the largest element in a given column.
For example, given a matrix A=[1 300 5; 100 1 2; 2 200 7], I would like to output A=[300 1 5; 1 100 2; 200 2 7].
I can do this using a for loop, but I've been hammered with the idea that I should always look for a matrix operation to do anything in matlab.