% Unique(a) - unique columns of a matrix
%
function j = Unique(a)

global octave;

[b j] = SortCols(a);

n = size(a,2);		% columns(a)

match = all((b(:,1:n-1) == b(:,[2:n])));	% compare adjacent columns

if( octave)
  match = [match, 0];				% octave requires the right size
end

j(match) = [];					% eliminate duplicates
