In Matlab I have an array of structs("sort_on_this", ...)
How do I sort the array on the on sort_on_this
?
Example of what I am trying to do,
list_to_sort = [struct('a', 4), struct('a', 0), struct('a', 3), struct('a', 1)]
sort(list_to_sort on 'a') =
[struct('a', 0), struct('a', 1), struct('a', 3), struct('a', 4)]
edit: question is not duplicate, because the the other question has arrays within the struct that needed to be sorted whereas this is an array of structs that needs to be sorted.