findNsmallest

Finds the N smallest values in the input. Very fast.
237 Downloads
Updated 7 Jan 2013

View License

Example:
x = findNsmallest( [4 4 10 5 3 8], 3)

x =
4 4 3

Written in c, so the operation is fast. Type "mex findNSmallest.c" in matlab before use.

You might need a free compiler if it was not installed with your matlab:
http://www.mathworks.com/support/compilers/R2012b/win64.html

Cite As

Mattias Karlsson (2024). findNsmallest (https://www.mathworks.com/matlabcentral/fileexchange/39727-findnsmallest), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Matrix Indexing in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

findNsmallest/

Version Published Release Notes
1.1.0.0

Added example to description

1.0.0.0