nth_element

MEX wrap of C++ nth_element. Plus fast_median, a faster median function. In-place and parallel.

Download
Download

You are now following this Submission

Cite As

Peter Li (2026). nth_element (https://www.mathworks.com/matlabcentral/fileexchange/29453-nth_element), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.9.0

Bugfix for 0xN empty inputs.

Download
1.8.0

Bug fixes

Download
1.7.0

Corrected OpenMP compile help in nth_element.m and added similar info in description here.

Download
1.5.0

Added OpenMP pragmas to support operating on multiple columns in parallel. Tried to clean up includes without complicating mex build process.

Download
1.3.0

Added in-place editing.

Download
1.2.0

Fixed void pointer return to void so that fancier C++ compilers will not complain about missing return type.

Download
1.1.0

Just updating licenses to match FreeBSD required by MatLab central. Also added a little documentation to source files.

Download
1.0.0

Download