1function p = cs_randperm (n, seed) %#ok 2%CS_RANDPERM random permutation. 3% p = cs_randperm (n) returns a repeatable random permutation of 1:n. 4% p = cs_randperm (n,seed) returns the random permutation using the given 5% seed for the random number generator (try cs_randperm (n,rand)), where 6% seed is not 0 or -1. Two special cases are not random permutations at all: 7% p=cs_randperm (n,0) is 1:n, and p=cs_randperm (n,-1) is n:-1:1. 8% This function does not change RAND's state. 9% 10% Example: 11% p = cs_randperm (10) 12% 13% See also CS_DMPERM, RAND, RANDPERM 14 15% Copyright 2006-2012, Timothy A. Davis, http://www.suitesparse.com 16 17error ('cs_randperm mexFunction not found') ; 18