I have a map containers.Map(array1, array2) that I would like to sort according to the values in array1. There is a fairly large amount of data contained in the arrays (~50,000 elements in each).
Is there a simple way to do this, perhaps using some built-in MATLAB feature?
Environment is MATLAB 2012. array1 is a character array.
Thanks in advance!
Since a
container.Mapis a dictionary or hash table implementation you cannot define some ordering of the elements within the data structure itself. However, by default MATLAB sortskeysandvalues(according tokeys) when you query for them: