-1

I have a cell array 5x1 contains directories of 5 image files like:

C:\Program Files\file1.jpg
C:\Program Files\file5.jpg
C:\Program Files\file2.jpg

and so on

The order of the files is missed up. How can I sort this cell array? for example:

file1.jpg
file2.jpg

and so on

Thanks!

Mikhail_Sam
  • 10,602
  • 11
  • 66
  • 102
Dani
  • 41
  • 1
  • 5

1 Answers1

0
a = {'C:\Program Files\file1.jpg';...
     'C:\Program Files\file5.jpg';...
     'C:\Program Files\file2.jpg'};
b = sort(a)
Markus Safar
  • 6,324
  • 5
  • 28
  • 44
NeitherNor
  • 254
  • 2
  • 7
  • @Dani The example I posted _does_ work, respectively does what it is supposed to do: After running it, b is the alphabetically sorted version of a (note that a is still unsorted). Please provide further information what exactly does not work, respectively what you exactly want. – NeitherNor Feb 05 '16 at 08:32