Rank: 11881 based on 0 downloads (last 30 days) and 0 file submitted



Personal Profile:


Watch this Author's files


Comments and Ratings by Jessica
Updated File Comments Rating
24 Oct 2011 Sorting a Cell Array This function will sort a cell array even if it is mixed. Author: Jeff Jackson

Just a note to anyone who wanted to use this for the same purpose as me.

If you have a cell array of strings, but want to sort by a column that contains numeric values as class string (i.e.


sort is notorious for treating strings a character at a time. So, if I used this function on the above vector, 20 would be sorted after 100 on account of the character 1 coming before 2.

I understand that this function would work wonderfully if that entire column was a number instead of a string containing a number, but depending on the application it may not be possible to force the class to double. In my case, I don't know if that column is going to contain strings or numbers until I need to sort it, so I ended up going my own route.

Very useful program though, thanks for sharing on FEX!

Contact us