Order all fields
Version 1.0.0.0 (1.27 KB) by
Paul A.M. Bune
Order fields of a structure array on all levels
A recursive version of MatLab function "orderfields".
Like "orderfields", function "OrderAllFields" orders fieldnames in a structure array by sorting them alphabetically. Contrary to "orderfields", which only orders top-level fields, function "OrderAllFields" orders fields of a structure array on all its levels (thereby also passing levels which have a cell array structure rather than a structure array structure).
Cite As
Paul A.M. Bune (2026). Order all fields (https://www.mathworks.com/matlabcentral/fileexchange/19459-order-all-fields), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2006a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Data Types in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired by: Sort Structure
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
