5.0

5.0 | 1 rating Rate this file 120 downloads (last 30 days) File Size: 11.15 KB File ID: #7212

asort: a pedestrian alphanumeric string sorter

by us

 

21 Mar 2005 (Updated 13 Dec 2006)

Code covered by BSD License  

numerically sorts an array or cell array of strings.

Download Now | Watch this File

File Information
Description

ASORT sorts an array or cell array of alphanumeric strings numerically rather than in ascii dictionary order

strings are divided into three different categories, which are returned in separate cells

- numerically sorted strings that contain only one readable number
- ascii dictionary order sorted strings that contain more than one readable or invalid numbers
- ascii dictionary order sorted strings that contain no numbers

see
> help asort
for explanations and options

this sorter can be used, for instance, to sort files with numerical extensions, eg,

f.1
f.2
f.3
f.10
f.21

look at the accompanying published m-file for a few examples

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements good spirits
Zip File Content  
HTML Files html/asdemo.html
Other Files asort.m,
asdemo.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
22 Mar 2005 urs (us) schwarz

due to a severe misunderstanding, a premature version was posted! i sincerely apologize. the ver tag must be 21-Mar-2005 17:33:11

20 Nov 2008 Jonathan Young

Works well. Thank you.

Please login to add a comment or rating.
Updates
23 Mar 2005

user requested option and another input error check

28 Mar 2005

added options to remove spaces and/or string-templates prior to processing; ver tag is 26-Mar-2005 17:54:54

28 Mar 2005

added more user requested options; ver tag is 28-Mar-2005 17:41:59

30 Mar 2005

check anomalous cases; ver tag is 30-Mar-2005 11:57:07

28 Nov 2005

the struct now returns index lists for each type of sorted input: anr/aix, srn/six, str/tix, such that anr=INP(aix), snr=INP(six), str=INP(tix); version tag 25-Nov-2005 14:16:47

28 Nov 2005

version tag 25-Nov-2005 20:46:56

29 Nov 2005

although the history reflects the update, the zip file is still not correct?! version tag 25-Nov-2005 20:46:56

13 Dec 2006

a previous revision 12/12/05 apparently never made it online (thanks to tom muylle for stumbling onto this omission!); the resubmission has the ver tag 13-Dec-2006 18:29:17

Tag Activity for this File
Tag Applied By Date/Time
sort us 22 Oct 2008 07:43:51
alphanumeric us 22 Oct 2008 07:43:51
numerical us 22 Oct 2008 07:43:51
ascii us 22 Oct 2008 07:43:51
dictionary us 22 Oct 2008 07:43:51
order us 22 Oct 2008 07:43:51
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com