Generalized Sorting

Sort any kind of data based on user-defined criteria.
4,2K Downloads
Aktualisiert 21. Jan 2005

Lizenz anzeigen

QUICKSORT allows the user to sort by any desired criteria. The user passes the data and a comparison function to the QUICKSORT and QUICKSORT returns an indexing vector sorted based on the comparison function.

The comparison function may be an inline function or a function handle. Function handles are an order of magnitude faster than inline functions. I use the TMP_HANDLE utility for creating temporary function handles in MATLAB 6.

QUICKSORT is implemented in m-code and uses a modified quicksort algorithm which sorts by "less than", "equal to" and "greater than". It is much slower than the builtin sort function, but also much more flexible.

Zitieren als

Nathan Thern (2026). Generalized Sorting (https://de.mathworks.com/matlabcentral/fileexchange/6756-generalized-sorting), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R10
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.0.0.0