Sort struct by field name
Show older comments
Hello,
I have the following struct:

I was wondering how to, using some code, reorganize the struct (i.e. sort it) according to the values in the Color field. So, all the blue would be together and then and then all the red. Can't find a clear solution, any help would be very much appreciated.
Thanks,
Mikel
2 Comments
Mikel Jimenez
on 21 Jul 2021
Edited: Jan
on 21 Jul 2021
Matt J
on 21 Jul 2021
Problem solved:)
If so, you should submit it as an answer and Accept-click it.
Accepted Answer
More Answers (0)
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!