Sort Structure

Version 1.0.0.0 (648 Bytes) by Mark Jobse
Sort fields in ascending order.
3.5K Downloads
Updated 23 Jul 2002

No License

It really bugged me that MATLAB automatically adds a new field in a structure at the end of that structure.

This function remedies that problem. After you add a new field, just sort it with this function and everything is put into the right order again.

Notice that this function also sorts the structures within the structures and puts them at the beginning, before the other fields.

Cite As

Mark Jobse (2024). Sort Structure (https://www.mathworks.com/matlabcentral/fileexchange/1958-sort-structure), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12.1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: Order all fields

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0