From: Matt Fig on 22 Apr 2010 20:20 This might be faster than KRON. % Data V = [1 2]; % EXPAND is on the FEX. F = @(A) [expand(V(:),[size(A,1),1]),A(cumsum(ones(size(A,1),length(V))),:)]; I4 = npermutek(V,4); % Use this to get to npermutek(V,8); % Engine. I8n = F(F(F(F(I4)))); I8 = npermutek(V,8); isequal(I8n,I8) % YES Note that you could do this much more simply by forming the leading column exactly as I do in the file NPERMUTEK iteslf, instead of trying to use a one line function call. That would probably be fastest of all.
From: Juliette Salexa on 23 Apr 2010 20:47 You're right, npermutek(1:4,14) is still (much) faster than F(F(I12)) I'll probably have to tolerate the speed for now, and try to learn how your code works later when I get the time, Thanks for all of the help though!
First
|
Prev
|
Pages: 1 2 Prev: Paper size not as specified! Print to PDF Next: Fsolve do not work for my ecuations |