sort and find in MATHEMATICA like in MATLAB
- To: mathgroup@smc.vnet.net
- Subject: [mg11021] sort and find in MATHEMATICA like in MATLAB
- From: Alexej Jerschow <Alexej.Jerschow@ico.unil.ch>
- Date: Mon, 16 Feb 1998 18:15:25 -0500
in MATLAB I would write: [dummy,index]=sort(a(:,i)); sorta=a(index,:); to sort the matrix a by it's i-th column. What's the easiest way to do the same in MATHEMATICA ? Another thing, again MATLAB: index=find(a(:,i) == 0); sorta=a(index,:); to remove lines, which have zeros in the i-th column. Thank you A. Jerschow