No BSD License  

Highlights from
htmltool

htmltool

by

 

The HTML Toolbox (HT) stores various crosslink information about Matlab programs using HTML.

A=lexsort(Z)
function A=lexsort(Z)
% usage:  A=lexsort(Z); 
% Bryce Gardner, gardner@ecn.purdue.edu, 317-494-0231
 
[nr,nc]=size(Z);
A=Z;                            % A is working matrix
 
A=abs(A)-64;                    % make A-Z become 1-26
i=find(A==(32-64));             % zero trailing spaces
A(i)=zeros(size(i));
i=find(A>26);                   % a-z
i2=find(A<27&A>0);              % A-Z
A(i)=(A(i)-32)*2;
A(i2)=A(i2)*2-1;                % precedence order is AaBbCcDd...
 
val=A*52.^([nc-1:-1:0]');       % convert each word to base 52 number
 
for level=1:nc,                 % remove leading spaces
  i=find(val<52^(nc-1));
  if i==[], break, end
  val(i)=val(i)*52;
end
 
[val,indx]=sort(val);           % sort base 52 encoded words
 
A=Z(indx,:);                    % reorder Z


Contact us