Combinations from a given set without repetition

Viewed 508

Suppose I have a matrix defined as follows

M = [C1 C2 C3 C4]

Where the C's are column vectors I want some efficient (i.e. no for loops) way of producing A vector such that

ResultVec = [C1 C2; 
             C1 C3; 
             C1 C4;
             C2 C3; 
             C2 C4; 
             C3 C4]

Thanks in advance!

2 Answers
Related