% sort_cols( w, s) - produce sorted column indices from [x s] = sort(w(:))
%
function CC = sort_cols( w, s)

[r c] = size(w);

CC = ones(r,1)*[1:c];

CC = CC(:);

CC = CC(s);
