Stephen Cobeldick (2021). Customizable Natural-Order Sort (https://www.mathworks.com/matlabcentral/fileexchange/34464-customizable-natural-order-sort), MATLAB Central File Exchange. Retrieved .
This is extremely helpful, thanks. Feels beyond natural
it works thank you so much for doing this saved me a lot of time to program it myself
Thank you, it is very useful! It is as the natsort of Python.
Save me days of programming. Got this going in 1 minute.
@Akim Borbuev: the function NATSORT will parse all of the input cell array, so if you only want to sort by the first column then you can use indexing to select just that column, e.g. given an nx2 cell array C:
[~,idx] = natsort(C(:,1));
D = C(idx,:);
I then used the second output from NATSORT to sort the rows of the cell array. Does that do what you want?
I have a nx2 cell which I would like to apply your natural order sort to the first column but with respective values in the second column. Is it possible?
It's good tool
Inspired by: asort: a pedestrian alphanumeric string sorter, sort_nat: Natural Order Sort, Number to Scientific Prefix, Number to Words, Natural-Order Row Sort, Natural-Order Filename Sort, Words to Number, Scientific Prefix to Number, Next Available Filename
Inspired: Words to Number, Scientific Prefix to Number, Number to Myriad, Number to Scientific Prefix, Numeric to Ordinal-String, Number to Words, Natural-Order Row Sort, Natural-Order Filename Sort, Interactive Regular Expression Tool
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!