A question about sort

How do I sort by the imaginary part of a complex matrix?what function?
thanks!

sort has a by params so do this

sort(x, by = imag)

2 Likes

nice!!!thank you !!!

You clipped too early the 2nd one is correct

got it,thanks!!!