|
|
Re: nchoosek all pairwise combinations
Posted:
Nov 27, 2012 5:32 AM
|
|
On 11/27/2012 4:29 AM, Jos (10584) wrote:
> > I did not see the word cell matrix in the OP message ... >
Well, they are characters and need to be in a 'matrix', so I assumed it has to be a cell array.
> but "much more work" is rather overstated: > > A = 'abcde' > [B1, B2] = ndgrid(A) > M = reshape(cellstr([B1(:) B2(:)]),5,5) >
Nice. I did not know about cellstr. That is definitly better. 2 lines shorter than mine :)
--Nasser
|
|