Natural order sorting sorts strings containing digits in a way such that the numerical value of the digits is taken into account. It is especially useful for sorting file names containing index numbers with different numbers of digits. Often, people will use leading zeros to get the right sort order, but with this function you don't have to do that. For example, with input of
a normal sort will give you
whereas, sort_nat will give you
Douglas Schwarz (2021). sort_nat: Natural Order Sort (https://www.mathworks.com/matlabcentral/fileexchange/10959-sort_nat-natural-order-sort), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Inspired: BiofilmQ, Depth of field calculator based on 2D digital image correlation data, Customizable Natural-Order Sort, philipptempel/matlab-projectmanagement, Natural-Order Row Sort, Natural-Order Filename Sort, Lilo : Fast and pixel-accurate stitching for 2D tiles, KANTOO, DETEQT
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!