Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



many random permutations?
Posted:
Jul 17, 2008 3:57 PM


What is the fastest way to compute 50000 random permutations on 10 symbols?
I had thought evaluating Z(50000,10), where
Z = @(m,n) arrayfun(@(o) randperm(n), 1:m, 'UniformOutput', false)';
would be good. But I must be making a mistake, because the following loop:
X=zeros(m,n); for k=1:m X(k,:)=randperm(n); end;
seems to be faster! Please let me know. I am new to Matlab and your advice & code would be very much appreciated.



