MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

sort and find in MATHEMATICA like in MATLAB



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



  • Prev by Date: RE: Re: Active Plots
  • Next by Date: Re: Get rid of Input cells when printing?
  • Prev by thread: Re: ListPlots, sizing
  • Next by thread: Re: sort and find in MATHEMATICA like in MATLAB