Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Sorting the name field in dir commnad
Replies: 7   Last Post: Jul 17, 2013 9:43 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Steven Lord

Posts: 17,944
Registered: 12/7/04
Re: Sorting the name field in dir commnad
Posted: Jul 17, 2013 9:43 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply



"Christopher Foy" <cfoy3@gatech.edu> wrote in message
news:ks549l$5sb$1@newscl01ah.mathworks.com...
> "Basim Kakakhel" wrote in message <iaqlb3$aks$1@fred.mathworks.com>...
>> Hello
>>
>> I have to upload CT images from my local drive. I am using the dir
>> command. In one of the data sets the OS is giving the names back in
>> random order and for my problem i need them to be sorted.
>>
>> A=dir('C:/Documents and Settings/n6753388/My Documents/MATLAB/Gel_3')
>>
>> Now if i do C=sort(A.name)


[~, indices] = sort({A.name});
B = A(indices)

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.