From: Matt Fig on
I see. If Jos is correct, then you can also do this with a slight modification of the solution I gave earlier.


[m,n] = size(A);
Rr = npermutek(1:n,m); % The "Row-Rank" matrix.
G = A((Rr-1)*m+repmat(1:m,n^m,1));

IIRC, COMBN and NPERMUTEK do the same thing using different methods.
From: Ozge Taskan on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hsrrsd$o20$1(a)fred.mathworks.com>...
> I see. If Jos is correct, then you can also do this with a slight modification of the solution I gave earlier.
>
>
> [m,n] = size(A);
> Rr = npermutek(1:n,m); % The "Row-Rank" matrix.
> G = A((Rr-1)*m+repmat(1:m,n^m,1));
>
> IIRC, COMBN and NPERMUTEK do the same thing using different methods.


thank you very much.
ozge
From: Jan Simon on
Dear Ozge!

> > IIRC, COMBN and NPERMUTEK do the same thing using different methods.

And if speed matters, the C-mex VChooseKRO might be helpful also:
http://www.mathworks.com/matlabcentral/fileexchange/26242

Jan
First  |  Prev  | 
Pages: 1 2
Prev: Fitting a surface
Next: plot a 3D table