function p = randperm(n);
%RANDPERM Random permutation.
%   RANDPERM(n) is a random permutation of the integers from 1 to n.
%   For example, RANDPERM(6) might be [2 4 5 6 1 3].
%   
%   Note that RANDPERM calls RAND and therefore changes RAND's state.
%
%   See also PERMUTE.

%   Copyright 1984-2000 The MathWorks, Inc.
%   $Revision: 5.8 $  $Date: 2000/06/02 17:59:27 $

[ignore,p] = sort(rand(1,n));
