File Exchange

image thumbnail

Case insensitive sort function

version 1.1.0.0 (539 Bytes) by Germán
Case insensitive sorting of a cell array of strings.

4 Downloads

Updated 26 Mar 2014

View License

Matlab's SORT function returns first upper case contents and then lower case. SORTI will sort by alphabet without considering the case
For example
sort({'A' 'a' 'B' 'b'})
will return
{'A' 'B' 'a' 'b'}
while SORTI will return
{'A' 'a' 'B' 'b'}

25/3/2014 Update: Now also returns the index vector I as in the SORT function

Cite As

Germán (2020). Case insensitive sort function (https://www.mathworks.com/matlabcentral/fileexchange/41745-case-insensitive-sort-function), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Eexactly what I needed to sort a directory file list in the same order that the file explorer does

michio

Updates

1.1.0.0

25/3/2014 Update: Now also returns the index vector I as in the SORT function

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags