www.gusucode.com > mbctools 工具箱 matlab 源码程序 > mbctools/@sweepset/sort.m

    function map = sort(map)
% SWEEPSET/SORT sorts sweepset into alphabetical order on variable name

%  Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc.




% ------------------------------------------------
% Sort variable list into alphabetical name order.
% ------------------------------------------------
[temp2, newVarIndex] = sort({map.var.name});
% rearrange map.var 
S = substruct('()', {':', newVarIndex});
map = subsref(map, S);