Faster median in Matlab

There are O(n) algorithms for finding a median, yet Matlab uses an O(n log n) algo (sorting an entire list, then taking the middle element). Here is a nicely written mex file that performs medians faster (on my computer, about 3x faster).

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s