File Exchange Pick of the Week

Our best user submissions


Will's pick this week is ranker(data) by R P.

They say it's the little things in life. I find this simple little function oddly compelling. Pass it a matrix, and it returns a similarly sized matrix that ranks the input's values from lowest to highest.

Be advised that this example comes with some limitations. It doesn't fully support:
  • Matrices of 3 or more dimensions
  • Imaginary numbers
  • 3 or more tie values
But for the most common use case, double precision values in a 1 or 2D array, it works great. Plus, it supports integers, strings, and chars.

Let us know what you think here or leave a comment for R P.
  • print


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.