Generalized Sorting
by Nathan Thern
19 Jan 2005
(Updated 21 Jan 2005)
Sort any kind of data based on user-defined criteria.
|
Watch this File
|
| File Information |
| Description |
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. |
| MATLAB release |
MATLAB 5.2 (R10)
|
| Other requirements |
Requires Matlab 6 or higher for function handle usage. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (7) |
| 08 Apr 2006 |
Steve Block
|
|
|
| 02 Jun 2006 |
Urban Novak
|
|
|
| 04 Mar 2007 |
Miks Böllér
|
|
|
| 18 Mar 2007 |
Guido Longoni
|
|
|
| 28 Jun 2007 |
Joe Daz
|
|
|
| 12 Mar 2008 |
Jan Moringen
|
|
|
| 03 Feb 2011 |
Matthew
|
|
|
|
Contact us at files@mathworks.com