I am trying to understand the command sortrows using the option “by”.
If I have a 3x2 array v:
v = [1 2; 2 4; 3 1]
If I want to sort it by the second column, then I have to do:
u=sortrows(v, by=x -> x)
I understand that the construction x -> x is an anonymous function.
However, why the construction
x -> x means that it should sort array v by the 2nd column ? Can someone provide a little bit more of detail about it ?