combinations

Carlo de Falco carlo.defalco at gmail.com
Sun May 31 14:24:01 CDT 2009


On 31 May 2009, at 20:30, Carlo Rossi wrote:

> Hello,
>  given A = [1; 2; 3]
> I need a vector of combination without repetition like this:
>
> (1,2), (1,3), (2,3)
>
> is there any matlab function?
> I didn't find it!
> thanks,
>

try

A = [1; 2; 3];
unique(sort (perms (A)(:,[1 2]), 2), 'rows')

HTH,
c.


More information about the Help-octave mailing list