%% Order Fields by Name
% Create a structure with several fields.

S1 = struct('b',1,'B',2,'a',3,'A',4)

%
% Order the fields. This syntax orders the fields by their names, in ASCII order.

S = orderfields(S1)

% Copyright 2018 The MathWorks, Inc.