Just wanted to report back in with my final solution! Sorting by=abs2
worked great on almost all cases. In the end though there were a bunch of cases where Matlab was sorting things in a really non-sensical manner and so my median output wasn’t matching. Luckily a Matlab buddy of mine pointed out that Matlab sorts first by absolute magnitude and then by phase angle!
So in the end this worked like a charm:
by=x->(abs2(x), angle(x))